EVL

Table of Contents


Products, services and company names referenced in this document may be either trademarks or registered trademarks of their respective owners.

Copyright © 2017–2020 EVL Tool, s.r.o.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.

Write

Write <f_in> into a <file>.

Besides below mentioned options, which changes file suffix behaviour, one can use generic ‘--cmd=<cmd>’ option, which calls something like ‘| <cmd> > <file>’ at the end. <cmd> can be also a pipeline. See examples below for inspiration.

Write

is to be used in EVS job structure definition file. <f_out> is either output file or flow name.

evl write

is intended for standalone usage, i.e. to be invoked from command line and and write to standard output.

EVD is EVL data definition file, for details see evl-evd(5).

Suffixes:

Write component acts according to file suffixes by default:

.gz,.GZ, .Z,.zip, *.bz2

when commpression suffix is presented in <file> name, then ‘gzip’ is called to compress the file

*.avro[<compression_suffix>]

for Avro file, ‘evl writeavro’ command is used

*.csv[<compression_suffix>]

for CSV file, option ‘--text-output’ is used

*.parq[uet][<compression_suffix>]

for Parquet file, ‘evl writeparquet’ command is used, with appropriate compression (snappy or gzip)

*.qvd

for Qlik’s QVD file, ‘evl writeqvd’ command is used

*.qvx

for Qlik’s QVX file, ‘evl writeqvx’ command is used

*.xlsx

for XLSX file, ‘evl writexlsx’ command is used

*.xml[<compression_suffix>]

for XML file, ‘evl writexml’ command is used

Synopsis

Write
  <f_in> <file> (<evd>|-d <inline_evd>) [--append]
  [--footer-file=<f_in>] [--header-file=<f_in> | --header] 
  [ --avro |
    --json [--omit-null-fields] |
    --parquet |
    --qvd | --qvx
    --xlsx
    --xml [--document-tag=<tag>] [--record-tag=<tag>] [--vector-element-tag=<tag>]
  ]
  [--gz] [--cmd=<cmd>] [--ignore-suffix]
  [-v|--validate] [-x|--text-input] [-y|--text-output]
  [--text-input-dos-eol] [--text-output-dos-eol]
  [--text-input-mac-eol] [--text-output-mac-eol]

evl write
  <file> (<evd>|-d <inline_evd>) [--append]
  [--footer-file=<file>] [--header-file=<file>] 
  [ --avro |
  [ --csv [--header] |
    --json [--omit-null-fields] |
    --parquet |
    --qvd | --qvx
    --xlsx
    --xml [--document-tag=<tag>] [--record-tag=<tag>] [--vector-element-tag=<tag>]
  ]
  [--gz] [--cmd=<cmd>] [--ignore-suffix]
  [-v|--validate] [-x|--text-input] [-y|--text-output]
  [--text-input-dos-eol] [--text-output-dos-eol]
  [--text-input-mac-eol] [--text-output-mac-eol]
  [--verbose]

evl write
  ( --help | --usage | --version )

Options

Standard options:

-d, --data-definition=<inline_evd>

either this option or the file <evd> must be presented.

--footer-file=<file>

add <file> after last written record

--header-file=<file>

add <file> before the first record

--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 input as text with CRLF

--text-input-mac-eol

suppose input as text with CR

-y, --text-output

write the output as text, not binary

--text-output-dos-eol

produce output as text with CRLF

--text-input-mac-eol

produce output as text with CR

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

Options changing file suffix behaviour:

--avro

whatever file’s suffix, write the file in Avro file format

--cmd=<cmd>

bash command <cmd> is used to write into <file>. In such case recognizing file’s suffix is switched off. See examples below for inspiration.

--csv

whatever file’s suffix, write the file in as CSV using delimiters based on EVD (same as –text-output option)

--gz

whatever file’s suffix, use ‘gzip’ to compress the file

--ignore-suffix

ignore file’s suffix, act only based on options

--json

whatever file’s suffix, write the file as JSON

--parquet

whatever file’s suffix, write the file in Parquet columnar file format

--qvd

whatever file’s suffix, write the file as Qlik’s QVD file

--qvx

whatever file’s suffix, write the file as Qlik’s QVX file

--xml

whatever file’s suffix, write the file as XML

--xlsx

whatever file’s suffix, write the file as MS Excel sheet

CSV specific options:

--header

add a header according to EVD

XML specific options:

--document-tag=<tag>

for other than XML file is this option ignored. Check ‘man evl writexml’ for details.

--record-tag=<tag>

for other than XML file is this option ignored. Check ‘man evl writexml’ for details.

--vector-element-tag=<tag>

for other than XML file is this option ignored. Check ‘man evl writexml’ for details.

JSON specific options:

--omit-null-fields

for other than JSON file is this option ignored. Check ‘man evl writejson’ for details.

Examples

1. Standard examples of standalone usage. Write gzipped file with header and validated data

types

gzip ‘example.csv’ with validating data types and adding header line:

evl write -d 'id int sep=";", value string sep="\n"' -h -vxy \
    < example.csv > example.csv.gz