Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT DBF
csv files, with schema/headers in another file
Mark Diamond
2006-08-17 12:03:18.0
Hi,
I have some data files that are csv format without the 1st line header. The user wants to provide me with the header separately. Can I do this with the CSV driver? I noticed the property "schemaFile". Can I use this option, and if so, what does the file need too look like (please show an example).

Thanks,
Mark
Re:csv files, with schema/headers in another file
HXTT Support
2006-08-17 20:26:33.0
>The user wants to provide me with the header separately.
What's the possible format of header? HXTT Text (CSV) supports ODBC schema file too.

>I noticed the property "schemaFile". Can I use this option, and if so, what
> does the file need too look like (please show an example).
schemaFile can contains many CREATE TABLE sqls. BTW, CREATE TABLE supports universal table declaration for a series of tables with the same table structure. '?' represents any single character, and '*' represents a string of zero or more characters. For instance, create table "*.log" (...); create table [*a?b.*"] (...). Universal table declaration is only visible for the current connection, and isn't prior to any specific table declaration. A schemaFie sample is below:

/* You needn't to remove remarks since HXTT Text (CSV) support those in sql.
String url = "jdbc:csv:/c:/logs?_CSV_Separator='|';cvsFileExtension=log;schemaFile=schema.txt";
You can use:
String sql = "SELECT * FROM \"big.log\" ";
Or
String sql = "SELECT * FROM big.log ";
Or
String sql = "SELECT * FROM big ";
*/


CREATE TABLE options
(
tab_name varchar(50),
option_name varchar(100),
item_index int,
item_name varchar(100),
sequence_number int,
selected int,
id int,
_CSV_Separator char(1) default ',',
_CSV_Quoter char(1) default '"',
_CSV_Header boolean default true
);

create table "2006*.log"
(
tab_name varchar(50),
option_name varchar(100),
item_index int,
item_name varchar(100),
sequence_number int,
selected int,
id int,
_CSV_Separator char(1) default '|'
);

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap