Hi,
I would like to check if some simple text files have been corrupted. A
manual/visual check of a few of the files shows that some of them
contain "garbage" characters in them. I can't directly "see" what those
characters are, but they can be found at any part of the file. The
information I'm after is simply the name of the file that is corrupted.
So I thought the following would do:
awk '/[^[:alnum:]]/ {print FILENAME}' *
Since, if IIUC, [:alnum:] represents all alphabet letters (upper and
lower case) and all digits, punctuation marks and symbols, which are
part of the uncorrupted files. Basically, print the file name a line
does NOT match any of these characters. Is this a good way to spot
those corrupted files?
Cheers,
--
Seb


|