Head
Command prints to output first <num>
records of input. Without option -n prints first 10
records.
- Head
-
is to be used in EVS job structure definition file.
<f_in>
and<f_out>
are either input and output file or flow name. - evl head
-
is intended for standalone usage, i.e. to be invoked from command line.
EVD is EVL data definition file, for details see evl-evd(5).
Synopsis
Head <f_in> <f_out> [<evd>|-d <inline_evd>] [-n [-]<num>] [-s|--skip-parse] [--validate] [skip-bom] [ -x|--text-input | --text-input-dos-eol | --text-input-mac-eol ] [ -y|--text-output | --text-output-dos-eol | --text-output-mac-eol ] evl head [<evd>|-d <inline_evd>] [-n [-]<num>] [-s|--skip-parse] [--validate] [ -x|--text-input | --text-input-dos-eol | --text-input-mac-eol ] [ -y|--text-output | --text-output-dos-eol | --text-output-mac-eol ] [-v|--verbose] evl head ( --help | --usage | --version )
Options
- -d, --data-definition=<inline_evd>
-
either this option or the file <evd> must be presented. Example: -d ’id int, user_id string(6) enc=iso-8859-1’
- -n, --records=[-]<num>
-
output first <num> records instead of the default first 10; or use -n -<num> to output all records except last last <num>
- -s, --skip-parse
-
this option has no effect with ’–records <num>’ (i.e. the case first <num> records are read and the rest is ignored). But with ’–records -<NUM>’ it does not parse all fields, but ’jump’ over record separator, i.e. the separator of the last field. Be careful with this option, it is particularly good for ’csv’ files, when you want to skip some weird formatted footer for example, but might be a wrong solution when some fields are separated by the same character as the last one.
- --skip-bom
-
skip utf-8 BOM (Byte order mark) from the beginning of input, i.e. EF BB BF. Windows usually add it to files in UTF8 encoding
- --validate
-
without this option, no fields are checked against data types. With this option, all output fields are checked
- -x, --text-input
-
suppose the input as text, not binary
- --text-input-dos-eol
-
suppose the input as text with CRLF as end of line
- --text-input-mac-eol
-
suppose the input as text with CR as end of line
- -y, --text-output
-
write the output as text, not binary
- --text-output-dos-eol
-
produce the output as text with CRLF as end of line
- --text-output-mac-eol
-
produce the output as text with CR as end of line
Standard options:
- --help
-
print this help and exit
- --usage
-
print short usage information and exit
- -v, --verbose
-
print to stderr info/debug messages of the component
- --version
-
print version and exit
Examples
- print to stdout only first 10 records:
evl head example.evd -xy <in.txt
- read the binary input and omit last 3 records without parsing them (i.e. they no need to have the
data structure defined by evd):
cat input.bin | evl head -sy -n-3 \ -d'id int sep=",", updated date sep="\n"' \ > output.txt