csv2qvd
Read <file.csv>
or standard input, guess data types or use <file.evd>
or
<inline_evd>
and write QVD file to <file.qvd>
or standard output. For guessing data
types it uses utility ‘csv2evd’.
Synopsis
csv2qvd [-i|--input=<file.csv>] [-o|--output=<file.qvd>] [-d|--date=<format>] [-h|--header=<field_name>,...] [-n|--no-header] [-l|--null=<string>] [-q|--quote=<char>] [-s|--separator=<char>] [-t|--timestamp=<format>] [-a|--dos-eol] [-b|--mac-eol] [--skip-bom] [-v|--verbose] csv2qvd (<file.evd>|-d <inline_evd>) [-i|--input=<file.csv>] [-o|--output=<file.qvd>] [-a|--dos-eol] [-b|--mac-eol] [--skip-bom] [-v|--verbose] csv2qvd ( --help | --usage | --version )
Options
Standard options:
- -d, --data-definition=<inline_evd>
-
either this option or the file <file.evd> must be presented to use already defined EVD
- -a, --dos-eol
-
suppose DOS end-of-line, i.e. replace CR+LF (‘\r\n’) by LF (‘\n’) on input
- -b, --mac-eol
-
suppose Mac end-of-line, i.e. replace CR (‘\r’) by LF (‘\n’) on input
- -i, --input=<file.csv>
-
read input
<file.csv>
instead of standard input - -o, --output=<file.qvd>
-
write output into
<file.qvd>
instead of standard output - --skip-bom
-
skip BOM if exists, i.e. remove 3 Bytes from the beginning of input. These 3 Bytes are usually inserted for UTF-8 files produced on Windows.
- -v, --verbose
-
print to STDERR info/debug messages
- --help
-
print this help and exit
- --usage
-
print short usage information and exit
- --version
-
print version and exit
csv2evd options:
- --date=<format>
-
by default it tries only ‘%Y-%m-%d’, then ‘%Y%m%d’, then ‘%d.%m.%Y’
- -h, --header=<field_name>,...
-
use comma separated list of field names instead of header line, for example when there is no header in csv file (option ‘-n’ must be used) or when other field names sould be used
- -n, --no-header
-
with this option it suppose there is no header. Fields will be named ‘field_001’, ‘field_002’, etc.
- -l, --null=<string>
-
to specify what string is used for NULL values in CSV, empty string is allowed
- -q, --quote=<char>
-
do not guess if fields are quoted, but suppose
<char>
as quotation character - -s, --separator=<char>
-
do not guess the separator, but use
<char>
instead - --timestamp=<format>
-
by default it tries only ‘%Y-%m-%d %H:%M:%S’, then ‘%Y%m%d%H%M%S’
Examples
- Having some.csv:
id;started;value 1;2019-06-06;some string
The command:
csv2qvd --null="" < some.csv > some.qvd
will produce some.qvd file with these field:
id int null="" sep=";" value date("%Y-%m-%d") null="" sep=";" value string null="" sep="\n"