FTValid
FTValid is a windows command line program which can be used to validate the format/structure of a Fielded Text or CSV file.
Sometimes, CSV files are generated by hand or may be generated by programs which do not correctly encode the contents of fields in the file. Such a file may not be able to be parsed correctly. By validating the file’s format it may reduce the time (and frustration) involved with other people using such files.
FTValid uses a Fielded Text Meta file to define the format/structure of the CSV file. This Meta file is an XML file which specifies the fields and attributes of the CSV file.
Some CSV files also have one or more fields which form a key to the records in the file. Together, these fields need to be unique across all records in the file. FTValid can also check the uniqueness of a set of fields in the file.
The ftvalid.exe command line has the following syntax:
ftvalid.exe TextFile [TextFile ...] -m:MetaFile [-u:UniqueFields] [-i] [-h]
where
- TextFile is a CSV file to be validated.
- MetaFile is the Fielded Text Meta file used to validated the CSV file.
- UniqueFields is a comma separated list of fields (as specified by the Meta file) which form the key for the CSV file.
- -i option specifies that the Standard Input should also be validated (in addition to any Text Files specified).
- -h option displays help on the usage of FTValid.
A few notes about parameters in the command line:
- A text file path must be enclosed in double quotes if it contains a if it begins with a character.
- A unique field (in -u option) must be enclosed in double quotes if it contains , or character. Any character in a field must be specified with 2 characters.
- Options and Text Files can be specified in any order.
- Standard Input, Standard Output must be specified at end of command line.
FTValid will return one of the following Exit Codes:
- 0: Indicates all files were valid.
- 1: Indicates an error was detected.
In this case, a description of the error will be printed to standard error (normally console window).
Download from SourceForge1.
Disclaimer: This software is provided “as is” and we make no representations as to its accuracy, reliability or fit for use. Use at your own risk. ↩︎