Nautilus and Gedit fail to open text files
I have a whole load of text files that I saved when I used MS Windows but I can't open then in Nautilus or Gedit - both complain about invalid utf-8 data.
I can open them in Konqueror and Kedit and can see the invalid data - it's one character at the end of the file which Konqueror / Kedit represents as a square. If I delete that character then Nautilus and Gedit can open the files up. Is this a bug in Nautilus / Gedit or am I missing some fonts? Why does Konqueror / Kedit cope when the others can't? I'm using RHEL v3 on a IBM T41 laptop. Cheers |
I don't know why some editors are able to open them and others are not.
You are right about the character in those files and quite often I hear about it when someone tries to run a script which was created in windows notepad. They get this kind of error.... # ./test : bad interpreter: No such file or directory Here is a script which may help you get rid of the problem. For example, the text files are in /home/images... Code:
#!/bin/bash |
Quote:
it kind of works - the test file I used can now be opened but half of the real text is missing!! Alan |
I'm glad you are smart and use a test file to see if it works. :)
Maybe it's because I tried to overwrite an open file in this line... cat $i | tr -d '\015' > $i Edit: this one is a better idea if you have spaces in the file name... Code:
#!/bin/bash |
All times are GMT -5. The time now is 04:31 PM. |