ffe (Flat file extractor) – Tool for parsing flat and CSV files and converting them to different formats
Sponsored Link
Main areas of use are:
* Extracting particular fields or records from a flat file, text or binary
* Converting data from one format to an other, e.g. from CSV to fixed length
* Verifying a flat file structure
* Testing tool for flat file development
* Displaying flat file content in human readable form
* Modifying flat file structures
* Map flat file fields to another format
Main features
* Command-line tool
* Reads standard input and writes to standard output as default
* One input file can contain several types of records (lines or binary blocks)
* Fields in a flat file can be fixed length text or binary fields or separated fields
* Input file structure and output definitions are independent, meaning one output format can be used with several input files
* Input file structure and output format are configurable, they are not predefined
* Output can be formatted e.g.: fixed length, separated, tokenized, XML, SQL,...
* ffe tries to guess the input format, user needs not to give it as a parameter
Install ffe in ubuntu
sudo apt-get install ffe
Example
Example of fixed length flat file containing fields ‘FirstName','LastName' and ‘Age':
John Ripper 23
Scott Tiger 45
Mary Moore 41
This file can be printed in XML with the following configuration:
structure personnel {
type fixed
output XML
record person {
field FirstName 9
field LastName 13
field Age 2
}
}
output XML {
file_header "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
data "<%n>%d</%n>\n"
record_header "<%r>\n"
record_trailer "</%r>\n"
indent " "
}
I like this – can see many uses for a tool like this. Thanks 🙂