Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

NAME

csv2excel - CSV to Excel format converter

SYNOPSIS

csv2excel [OPTION...] [-s] FILE...
csv2excel [OPTION...] [-o OUTPUT_FILE]

DESCRIPTION

Convert comma separated value (CSV) FILEs into Microsoft Excel files. The output file will have the same file name as FILE has with the file extension replaced with .xlsx. The output will be written to the standard output if -s option is specified.
If FILEs are not specified, csv2excel reads its input from standard input and writes output to standard output; the output can be redirected to a file by -o option.

OPTIONS

If both short-form and long-form are specified on the command line, the long-form will take precedence.

-c CHARSET
The character set to be used for encoding/decoding data; supported values are: 'UTF-8' and 'platform-default', default to 'UTF-8'.

-d DELIMITER
The delimiter for separating data; default to ','. Use word 'tab' for setting tab character as delimiter.

-i
Prompt before overwriting the output file.

-o OUTPUT_FILE
Redirect output to the file specified by OUTPUT_FILE if the input is read from standard input.

-p
Preserve the last-modified time of the output file if it exists.

-s
Redirect output to the standard output if FILEs are specified.

-t TYPE
Indicate the Excel file format type for the output file. Supported types are: '2003', '2007', default to '2007'.

-NT, --null-text BOOLEAN
Indicates if NULL value is represented as (null) text, default to 'false'. See BOOLEAN VALUES section below for supported BOOLEAN values.

-PA, --datetime PATTERN
Pattern for formatting date and time, default to 'yyyyMMdd HH:mm:ss.SSS'.

-PD, --date PATTERN
Pattern for formatting date, default to 'yyyyMMdd'.

-PT, --time PATTERN
Pattern for formatting time, default to 'HH:mm:ss.SSS'.

-SQ, --string-quote IDENTIFIER
String quoted identifier; supported values are: 'double-quote', 'single-quote', 'none', default to 'double-quote'.

-wi, --worksheet-index INDEX
Indicate the index of the worksheet to which output to be written, default to '0'. The worksheet index is zero-based. Empty worksheet(s) will be created if INDEX is greater than 0.

-wn, --worksheet-name NAME
Set the name of the worksheet to which output to be written.

BOOLEAN VALUES

The followings are supported BOOLEAN values: 'true', 'false', 'yes', 'no', 'y', 'n', 'on', 'off', '1', '0'.

NOTES

On -t option, .xls file extension is used if TYPE is set to '2003'.
In Excel 2003, the maximum worksheet size is 65,536 rows by 256 columns. In Excel 2007, the maximum worksheet size is 1,048,576 rows by 16,384 columns. If the number of CSV rows exceeds worksheet size, multiple worksheets are created. If the number of CSV columns exceeds worksheet size, those columns that go beyond the limitation are dropped.

SEE ALSO

csv2html
csv2json
csv2xml
excel2csv