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
|
>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 '|'
);
|