Convert Excel files via Command Line with Advanced XLS Converter

Single Excel file conversion

"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" file.xls | file.xlsx | file.xlsm | /LIST:file.txt outfile.ext [/FILTER | /FILTER2 | /WFILTER | /COLUMNS | /COLUMNSLIST | /SKIPDUPS | /NOWRITEHDR | /SKIPEMPTY | /SHEETNUM | /SHEETNAMES | /SORTBY | /OPEN | /TEMPLATE | /SRCHDR | /KEEPDATE | /SHEETS2BOOKS] | @cmdoptionsfile

where ext - (.dbf, .txt, .htm, .prg, .xml, .xls, xlsx, .csv, .sql, .rtf, .tsv, .json)

example for .xls format:
"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" file.xls out.csv

example for .xlsx format:
"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" file.xlsx out.csv

Convert multiple excel files at once (Batch conversion)

"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" *.xls destdir /TOEXT [OPTIONS]

where EXT - (dbf, txt, htm, prg, xml, xls, xlsx, csv, tsv, sql, rtf, tsv, json)
"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" c:\mybase\*.xlsx c:\out\ /TOCSV

Common options

/LIST - list of files, one file per line. Example: /LIST:d:\Excel\mylist.txt

/LOG|/LOG:logfile - generate log file
xlscnv.exe sample.xls sample.xls /LOG

/OPEN - open after conversion.
/HDR - for put the fields names in first line.

/LF - use LF(0xA) as row delimiter (useful for unix systems), default: CRLF
/REVERSE - export in reverse order

/RMSRC - remove source files after conversion

/SHEETNUM:N - Convert only sheet N

/sheetnames:Name1,Name2 - Select sheets by name

/NOWRITEHDR - No write header

/SRCHDR - Header in the first line

/SKIPDUPS - skip duplicated rows

/SKIPEMPTY - skip empty rows

/TEMPLATE:file - using templates

/SORTBY:Col - sort rows by column: Col

/COLUMNS - set columns for export

example 1
"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" sample.xls out.dbf /COLUMNS:CUST_NO:custom numbers,NAME:custom name

example 2
"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" sample.xls sample.csv /COLUMNS:NAME,STREET

/COLUMNSLIST - set columns for export from text file

xlscnv.exe sample.xls sample.csv /COLUMNSLIST:columns
where columns - text file with column names (one per line)


filter file format:

Field name:Value|Expression



single xls file conversion:

"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" mytable.xls out.txt /SEP;

multiple excel file conversion:

"c:\Program Files (x86)\Advanced XLS Converter\xlscnv.exe" c:\base\*.xls c:\exports\ /TOSQL

Text/CSV options

/SEPx - where x delimiter

/SEPPIPE - use '|' as delimiter
/SEPTAB - use Tab as delimiter

/UTF8 - use UTF-8 encoding
/NOBOM - UTF-8 without BOM

/SINGLEQUOTA - single quotas
/DOUBLEQUOTA - double quotas

/ALLQUOTES - enclose all fields in quotas.

DBF options

/DBASE3 - DBASE III format
/DBASE4 - DBASE IV format
/VFP - Visual Foxpro format

"c:\Program Files\Advanced XLS Converter\xlscnv.exe" c:\base\myfile.xls out.dbf /DBASE4

SQL options

/ORACLE - use Oracle syntax
/MYSQL - use MySQL syntax
/MSSQL - use MS SQL Server syntax
/POSTGRESQL - PostgreSQL syntax
/INSERTWITHCOLUMNS - INSERT statement with column names

Excel options

/SHEETNUM:N - Select only sheet N

export to Excel 2003 (xml-based):
"c:\Program Files\Advanced XLS Converter\xlscnv.exe" file.xls outfile.xls /XML

HTML options

/ASFORM - one record on the one page

/NUMBER - record number as first column

/MAXPERPAGE - maximum records on the one page
example: /MAXPERPAGE=100

/TITLE - page title
example: /TITLE=Customers

/COLOR - Text color
example: /COLOR=#0000ff

/BACKGROUND - Background color

Updated Tue, 11 Oct 2022

Back to XLS Converter Home