Import text file crunching library for Java/Groovy ?
- by devdude
In a lot of real life implementations of applications we face the requirement to import some kind of (text) files. Usually we would implement some (hardcoded?) logic to validate the file (eg. proper header, proper number of delimiters, proper date/time value,etc.). Eventually also need to check for the existence of related data in a table (eg. value of field 1 in text file must have an entry in some basic data table).
While XML solves this (to some extend) with XSD and DTD, we end up hacking this again and again for proprietary text file formats.
Is there any library or framework that allows the creation of templates similar to the xsd approach ? This would make it way more flexible to react on file format changes or implement new formats.
Thanks for any hints
Sven