How to easily identify a corrupted text file, or any file for that matter?
Posted on 2011-10-09
We have had a hard disk corruption and some of the text files are unreadable, i.e. If you open it in notepad, you will see strange characters, boxes, and sometimes text from another file.
Previously, I have writtne VBscript to read the file and take the first line of the file and if it is what I expected from the file, I will assume that this file is fine.
However, seems that there is a loop hole that I have seen a file to be fine halfway and corrupted as anything halfway down.
I may have to rewrite my script to completely parse the file and see if it's ok syntax-wise, however that is going to be one heck of a job.
Is there any easier way to do this, to identify if a text file has been corrupted?
We also have video files in the drive, the only way to know if it's ok is to try to play it on the player. I did try extracting the meta data out of the video files and assume that if the meta data cannot be extracted, the file is corrupt. Works well until we found videos that are unplayable, but meta-data is good.