GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
EXCEL2CSV(1) User Contributed Perl Documentation EXCEL2CSV(1)

excel2csv

By default, the CSV output goes to STDOUT:

 excel2csv --file file.xlsx > file.csv

You can also save to a file directly:

 excel2csv --file file.xlsx --output file.csv

Or even write to STDERR:

 excel2csv --file file.xlsx --output STDERR

By default, the CSV file will be in the UTF-8 encoding. You can change the encoding:

 excel2csv --file file.xlsx --output_encoding CP1252 --output file_cp1252.csv

It can also autmatically trim whitespace from around all cell values:

 excel2csv --file file.xlsx --trim

Use the --sheet option to read from a sheet/tab other than the first one. The following will pull from sheet 2:

 excel2csv --file file.xlsx --sheet 2

You do not have to pass the --file and --output option keys. The first non-keyed option will be used as the filename, and the second non-keyed option will be the output. Other keyed options can still be passed in:

 excel2csv file.xlsx file.csv --trim

Bash file globbing is also supported. This will parse through each xls file in the current directory and print out the CSV output from each one to STDOUT.

 excel2csv *.xls

gz files can also be parsed:

 excel2csv file.xls.gz
 excel2csv *.xls.gz

You can even pipe in the binary excel data:

 cat file.xls | excel2csv > file.csv

The path to the spreadsheet file.
The path to where you want to store the CSV file.

If you do not pass this, the CSV output will go to STDOUT.

If this is a directory, a csv filename will be created automatically using the excel filename. The extension will simply be changed to .csv.

Be default, the raw cell values from xls files will be returned. If this is set, the "formatted" cell values will be returned instead.

This is really only useful to get formatted numbers, such as currency values that include a currency symbol, or large numbers that contain commas.

If set, whitespace around each value will be trimmed.
The character encoding that you want the CSV output to be in. Defaults to UTF-8.
If this many blank lines are found, parsing will stop. Defaults to 10.
The sheet (tab) in the spreadsheet to parse. Defaults to sheet 1.

You can pass this option multiple times to parse multiple sheets. Each sheet's data will be added sequentially to the same CSV output.

If set, only rows that have a value matching this regex will be returned.
Use color when outputting results. This option only makes sense when you are outputting to STDOUT.

When using --match, each match will also be highlighted in red.

2021-06-23 perl v5.40.2

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.