Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
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
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
csv files, with schema/headers in another file
Mark Diamond
2006-08-17 12:03:18
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
>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
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap