1

In my file due to some reasons some invalid characters are coming making it very huge file. Sample below of one line. I am not sure where these characters are coming from(I am using google drive online text editor). Please help me to find and replace and all and to avoid getting such characters?

It is a file name of a zip file, however not sure how those weird characters came.

This is a screenshot of a text file (containing the filenames of a directory). The filenames were obtained by running find . -maxdepth 1 -type f | sed 's/\.\///g'. I then saved this text file in google drive. When I open the file, I can see these characters:

looks like ’ characters are converted to â€â„Â

enter image description here

terdon
  • 234,489
  • 66
  • 447
  • 667
  • 1
    So it's a Zip archive that is called `telegramfiles.txt`, and you have opened it in Vim? Why don't you just rename it `telegramfiles.zip` and unzip it? (if it even needs renaming) – Kusalananda Jan 22 '22 at 11:06
  • nope. It is a text file containing many filenames – parvathy pillai Jan 22 '22 at 11:26
  • Its not clear from the question, but are you saying this is a valid text document in Google Docs? If so, how did you save it? It's fairly straight forward to save a document in any format from Google Docs. – Kusalananda Jan 22 '22 at 11:31
  • it is a screenshot of a text file(containing the filenames of a directory). The filenames are got by running find . -maxdepth 1 -type f | sed 's/\.\///g' command. then i save this text file in google drive. if i reopen the file these characters are showing up – parvathy pillai Jan 22 '22 at 11:38
  • character ’ may be converted to ’ I think – parvathy pillai Jan 22 '22 at 11:49
  • if you see `’` then the encodings are incorrect. That's an apostrophe in UTF-8. The input is in UTF-8 but you're opening the file as ISO-8859-1 – phuclv Jan 22 '22 at 14:12

0 Answers0