ffe (Flat file extractor) – Tool for parsing flat and CSV files and converting them to different formats

Sponsored Link
Flat file extractor (ffe) can be used for parsing different flat file structures and printing them in different formats. ffe can also process fixed length binary files. ffe is a command line tool developed in GNU/Linux environment and it is distributed under GNU General Public License 2 or later. ffe has been build using GNU autotools so it should be possible to build ffe in many kinds UNIX-like systems.
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 " "
}

Sponsored Link

You may also like...

1 Response

  1. RawShark says:

    I like this – can see many uses for a tool like this. Thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *