Create Database from CSV (Csv2Db) |
Description:
Csv2Db allows you to create a new database (MDB or DBF) from
a XML formatted input file. Csv2Db will first analyze the input and
create a analyze file with the column names and data type (see DbAna
for details)
By default Csv2Db writes the output to New.mdb
unless you specify a database with the -d option (like -d new.dbf).
The table name is extracted from the input file unless you specify
a table name (applies only for new MDB databases not to DBF).
The CSV data is loaded into the new database unless yoiu specify the -c option.
Csv2Db writes all diagnostics to a log file "logs/yyyymmdd/Csv2Db.log"
Note that In demo mode up to 100 records can be analyzed.
Syntax:
usage: Csv2Db [-csn] [-d{db}] -i[!]{in}
[-t{tab}] [-f{font}]
-d = DATABASE: Specify new database filename (MDB or DBF) (default New.mdb)
-i = INPUT : Specify XML input file (! specified an analyze file directly)
-t = TABLE : Specify Table name (only used for new MDB databases)
-c =CREATEONLY: Dont load, just create empty database with structure)
-s = SILENT : Dont show diagnostics (XX Records written..)
-n = NOHEADER: Input has no header line for column names
(Logfile written to logs/YYYYMMDD/Csv2Db.log
Example: Csv2Db -i Employees.XML
Example:
Csv2Db
-d Emp.DBF -i Employees.CSV
Line 9: scanned Employees.CSV
Csv2Db: Create new Database 'Emp.DBF' from Employees_ana.txt
Created
a new DBF database (Emp.DBF) with the structure matching Employees.xml.
To load data into the new database use DbLoad
If
the output database aleady exists the following prompt appears (unless you
specify -s):
Logfile:
If you run this command on Feb 18th, 2001 the logfile
would be created in:
logs/20010218/Csv2Db.log
INIT |13:35:03.438 |====== Opening
c:/dbtkxml/logs/20010218/Csv2Db.log ======
DbTkXml |16:07:06.856 |ExecCmd: analyze
Employees.CSV
Analyze |16:07:06.926 |Input=Employees.CSV,
Analyze |16:07:06.986 |9 Record(s) processed from 'Employees.CSV'++Result in 'Employees_ana.txt'
DbTkXml |16:07:07.026 |ExecCmd: CreateDb Employees_ana.txt|Emp.DBF