I have a text file that contains lots of data arranges as String separated by lines. I am facing an error in another program that uses this file. It seems there is a non alphabetical/numerical character. How can I search for it? How can I remove it if found ?
EDIT: including spaces (i.e, the line is white space).
Try this command:
cat bigfile.txt| od -cx | lessUnprintable characters will show up as “\xxx”. Printable characters will be displayed as ASCII text. All characters – printable or not – will be displayed as hex, and you can see the offsets in the file.
Once you know 1) what the offending characters are, or 2) where they’re located, you can develop a strategy for eliminating them. Perhaps all you need is a simple “sed” script.
PS:
“vi -b” would probably also work, even for what might seem gargantuan files. IMHO…