Convert DBF files via Command Line

Single file conversion



dbfcnv.exe file.dbf outfile.ext [OPTIONS] | @cmdfile

example:
dbfcnv.exe file.dbf out.csv

Batch conversion



dbfcnv.exe *.dbf destdir /TOEXT [OPTIONS]

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

example
dbfcnv.exe c:\mybase\*.dbf c:\out\ /TOXLSX

Using list of file from text file (one file per line)
dbfcnv.exe /LIST:c:\mybase\list.txt c:\out\ /TOXLSX

Common options


/CLEARHISTORY - Clear the history list.

/HISTORYTO - Save history list to text file.

/LOG|/LOG:logfile - generate log file

dbfcnv.exe sample.dbf sample.xls /LOG

Append to exit log file
dbfcnv.exe sample.dbf sample.xls /LOG /LOGAPPEND

/SKIPD - skip deleted records

/SKIPEMPTY - skip empty records.

/KEEPDATE - Keep original timestamp

/ONLYDELETED - export only deleted records

/DEC0 - round for numeric fields

/HDR - for put the fields names in first line.
/NOHDR - not put the fields names in first line.

/HDRLOWERCASE - for put the fields names in the lower case

/HDRCAPCASE - for put the fields names in the Capitalize format

/LF - use LF(0xA) as row delimiter (useful for unix systems), default: CRLF

/REVERSE - export in reverse order

/CONSOLE - Output to Console

/RMSRC - Remove source file

/UTF8 - Convert to UTF-8 encoding

/tm - Shows conversion time in log file or console

/COLUMNS - set columns for export

syntax:
/COLUMNS:field1[:newname],field2[:newname] [/EXCLUDE]

example 1
dbfcnv.exe sample.dbf sample.xls /COLUMNS:CUST_NO:custom numbers,NAME:custom name

example 2
dbfcnv.exe sample.dbf sample.csv /COLUMNS:NAME,STREET

example 2 (exclude columns)
dbfcnv.exe sample.dbf sample.csv /COLUMNS:NAME,STREET /EXCLUDE


/COLUMNSLIST - set columns for export from text file
example:
dbfcnv.exe sample.dbf sample.csv /COLUMNSLIST:columns
where columns - text file with column names (one per line)

/WFILTER:Value|Long Value

/FILTER2:fld1:Value|Expression,fld1:Value|Expression

/FILTER:filterfile

filter file format:

Field name:Value|Expression


Examples:

single file conversion:

dbfcnv.exe mybase.dbf out.txt /SEP;

multiple file conversion:

dbfcnv.exe c:\base\*.dbf c:\exports\ /TOSQL

Text/CSV options


/SEPx - where x delimiter

/SAVELB - save the line breakes

/OUTTYPES - save field types in the first line

/OUTTYPES2 - save field types in the second line

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

/SINGLEQUOTA - single quotas
/DOUBLEQUOTA - double quotas

/ALLQUOTAS - enclose all fields in quotas.
/ROWID - record number as first column
/SKIPSECONDS - Save without seconds

dBase options



/DBASE3 - DBASE III format
/DBASE4 - DBASE IV format
/VFP - Visual Foxpro format
/DBASE7 - dBase Level 7 format

example:
dbfcnv.exe c:\base\myfile.dbf out.dbf /DBASE4

SQL options


/CREATEONLY - only CREATE TABLE commands
/ORACLE - use Oracle syntax
/MYSQL - use MySQL syntax
/SQL2000 - use SQL2000 syntax
/POSTGRESQL - PostgreSQL syntax

Excel options



export to Excel 2003 (xml-based):
dbfcnv.exe file.dbf outfile.xls /XML
/sheetname - set sheet name

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
/BACKGROUND=#c0c0c0

DOWNLOAD
for FREE

Updated Mon, 04 Nov 2024

Back to DBF Converter Home