gedit does not open files with a few invalid characters

Asked by Joseph Bylund

I'm trying to open a log file which has a few invalid characters and I get a "Could not open the file .... gedit has not been able to detect the character coding. Please check that you are not trying to open a binary file. Select a character coding from the menu and try again.". What I'm trying it to "cat -v" the file then open it with gedit, however as some of the log files are quite large this is an unnecessary step. Is there some way I can force it to open with an encoding then just display a ? or a box?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gedit Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sam_ (and-sam) said :
#1

To read large files in terminal you can use 'less'.
e.g. cat /var/log/syslog | less
or archived log files
zless /var/log/syslog.2.gz | less

looking for certain lines with e.g. 'grep'.
http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/

You may also check properties of the file -> open with ...

Can you help with this problem?

Provide an answer of your own, or ask Joseph Bylund for more information if necessary.

To post a message you must log in.