You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

NAME

excel2csv - Excel to CSV format converter

SYNOPSIS

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

DESCRIPTION

Convert Microsoft Excel FILEs into comma-separated value (CSV) files. The output file will have the same file name as FILE has with the file extension replaced with .csv. The output will be written to the standard output if -s option is specified.
If FILEs are not specified, excel2csv reads its input from standard input and writes output to standard output; the output can be redirected to a file by -o option
FILE is opened as an Excel 2007 file if its file extension is .xlsx, or as an Excel 2003 file if file extension is .xls; otherwise, it is opened as an Excel 2007 file by default. The default Excel file format type can be overwritten by -t option.

OPTIONS

-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.

-l LINE_SEPARATOR
The line separator to be used in the output file; supported values are: 'unix', 'windows', default to platform's line separator.

-i
Prompt before overwriting the output file.

-o OUTPUT_FILE
Redirect output to the file specified by OUTPUT_FILE if 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 reading standard input or FILE if the file extension of FILE is neither .xls nor .xlsx. Supported types are: '2003', '2007', default to '2007'.

-DQ, --date-quote IDENTIFIER
Date quoted identifier; supported values are: 'double-quote', 'single-quote', 'square-bracket', 'none', default to 'square-bracket'.

-NT, --null-text BOOLEAN
Set or not set text to (null) on NULL values, 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'.

-wc, --content-as-shown BOOLEAN
Save Excel contents as shown, default to 'false'. See BOOLEAN VALUES section below for supported BOOLEAN values.

-wi, --worksheet-index INDEX
Indicate the index of the worksheet from which data to be read, default to '0'. The worksheet index is zero-based.

-wn, --worksheet-name NAME
Indicate the name of the worksheet from which data is to be read.

BOOLEAN VALUES:

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

NOTES

On -o option, the .csv file extension will not be added to OUTPUT_FILE if OUTPUT_FILE does not have a file extension.
If both -wn and -wi are specified, -wn takes precedence.
In this release, excel2csv can only convert one worksheet at a time.

SEE ALSO

csv2excel



  • No labels