Morning all !

I'm writing a program that reads x amount of text files.
Each file has a header record, a bunch of detail records and then a footer record.

Due to the nature of these files it is possible that some can be corrupted.
Problem is they could be corrupted anywhere within the file.

Now ... I can code this with loads of IF THEN statements as I pluck each field out from each row, but I know there must be a neater way of checking them record by record, probably using a routine of some kind.

Has anyone out there done anything similar ? I'm just looking for a "neat" a way as possible really, rather than my old archaic way of doing things.

Thanks ....