I used a utility program many years ago which did a similar thing. Given a flat file, it could parse each record and check each column met certain requirements.
The basic blocks were typestypes, rangesranges and valuesvalues.
TypesTypes were very basic ones such as:
- String
- Int
- Float
- Date
For some of these columns, rangesranges could be defined. For example, you could say that for a certain column, values 101-999 were valid values.
For more complex columns, you could define the valid valuesvalues. E.g. for gender you might have:
- M
- F
- U
Simple but effective. We used it for all kinds of data files.