| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1 Program invocation
The format for running the ffe program is:
ffe option …
ffe supports the following options:
-c file--configuration=fileConfiguration is read from file, instead of ‘~/.fferc’ (‘ffe.rc’ in windows).
-s structure--structure=structureUse structure structure for input file, suppresses guessing.
-p output--print=outputUse output format output for printing. If not given, then the record or structure related output format is used. Printing can be suppressed using format no. Original data is printed using format raw.
-o file--output=fileWrite output to file instead of standard output.
-f list--field-list=listPrint only fields and constants listed in the comma separated list list. Order of names in list specifies also the printing order.
-e expression--expression=expressionPrint only those records for which the expression evaluates to true.
-a--andExpressions are combined with logical and, default is logical or. Note that if the same field and operator appear several time in expressions they are always compared with logical or.
-X--casecmpExpressions are evaluated using case insensitive comparison
-v--invert-matchPrint only those records which don’t match the expression.
-l--looseNormally
ffestops when it encounters an input line or binary block which doesn’t match any of the records in selected structure. Defining this option causesffecontinue despite the error. Note that invalid lines are reported only for text input. In case of binary input next valid block is silently searched.-r--replace=field=valueReplace fields contents with value in output. value can contain same directives as output option
data.-d--debugAll invalid input lines are written to ‘ffe_error_<pid>.log’, where ‘<pid>’ is the process ID.
-I--infoShow structure information in the configuration file and exit successfully. For every structure following information in shown:
Structures: Name, type and maximum record length.
Records: Name and length
Fields: Name, position and length. First position is number one.-?--helpPrint an informative help message describing the options and then exit successfully.
-V--versionPrint the version number of
ffeand then exit successfully.
All remaining options are names of input files, if no input files are specified or - is given, then the standard input is read.
Expressions (option ‘-e’, ‘--expression’)
Expression can be used to select specific records comparing field values. Expression has syntax fieldxvalue, where x is the comparison operator. Expression is used to compare field’s contents to value and if comparison is successful the record is printed. Several expressions can be given and at least one must evaluate to true in order to print a record. If option ‘-a’ is given all expressions must evaluate to true.
If value starts with string file: then the rest of value is considered as a file name.
Every line in file is used as value in comparison. Comparison evaluates true if one or more values matches, so this makes possible use several different values in comparison. Note: The file size is limited by available memory because the file contents is loaded to memory.
When comparing binary fields the value must have the representation which can be shown using the %d output directive. Note that the printing option hex-caps takes effect in comparison.
Expression notation:
- field=value
Field field is equal to value.
- field^value
Field field starts with value.
- field~value
Field field contains value.
- field!value
Field field is not equal to value.
- field?value
Field field matches the regular expression value.
ffesupports POSIX extended regular expressions.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 30, 2014 using texi2html 5.0.
