Hi All,
This might be a basic question... I need to write a script to find all/any Speacial/Null/Control Chars and Print Line Numbers from an input file.
Output something like
Null Characters in File Name at : Line Numbers
Line = Print the line
Control Characters in File Name at : Line Numbers
Line = Print the line
Please help.
-K
grep -n "[[:cntrl:]]" file
Hardest first: null is not handled by most tools. 'cat -v' can turn it into '^@' C/C++/PERL/JAVA/etc. can read byte by byte and translate anything. grep can print line numbers and lines containing [^ -~] (not between the space and tilde characters, the ASCII non-control characters).
Text does not normally have such, so the concept of lines and line numbers is funny. File names are in directories not flat files, generally, but a flat file could have a file name in it, if you can figure out how to frame it. Are you describing a process ot examine many files?