How can we skip some header lines from a text file, say with some report header (My Project Budget)?
|
Please email us a simple data sample, then we will provide a connection property to support that function soon.
|
Product report for FY 1996
- - - - - - - - - - - -
id,pid,sku,alias,caf,siz,typ,idate
1,1,100-10,Cola,TRUE,12,Can,03/25/1996
2,1,100-20,Diet Cola,TRUE,12,Can,04/01/1996
3,1,100-30,Caffeine Free Cola,FALSE,16,Bottle,04/01/1996
4,2,200-10,Old Fashioned,TRUE,12,Bottle,09/27/1995
5,2,200-20,Diet Root Beer,TRUE,16,Bottle,07/26/1996
6,2,200-30,Sasparilla,FALSE,12,Bottle,12/10/1996
7,2,200-40,Birch Beer,FALSE,16,Bottle,12/10/1996
8,3,300-10,Dark Cream,TRUE,20,Bottle,06/26/1996
9,3,300-20,Vanilla Cream,TRUE,20,Bottle,06/26/1996
10,3,300-30,Diet Cream,TRUE,12,Can,06/26/1996
11,4,400-10,Grape,FALSE,32,Bottle,10/01/1996
12,4,400-20,Orange,FALSE,32,Bottle,10/01/1996
13,4,400-30,Strawberry,FALSE,32,Bottle,10/01/1996
|
Supported. Please download the latest package. v2.2.015 provides _CSV_Comment to specify whether ther're some comment lines before csv header and data rows. If you use n (integer values), the first n lines will be ingored as comment. If you use some paragraphs, these paragraphs will be used for csv file creation, the total line number of comment will be used for existent file.
For instance:
Properties props=new Properties();
props.put("_CSV_Comment","3");
//Or props.put("_CSV_Comment","Product report for FY 1996\r\n- - - - - - - - - - - - \r\n\r\n");
Connection con DriverManager.getConnection(url,props);
create table FY1996 (_CSV_Separator char(1) default ',', _CSV_Quoter char(1) default null,_CSV_Header boolean default true,_CSV_Comment longvarchar default 'Product report for FY 1996\r\n- - - - - - - - - - - - \r\n\r\n');
Or
create table FY1996 (_CSV_Separator char(1) default ',', _CSV_Quoter char(1) default null,_CSV_Header boolean default true,_CSV_Comment longvarchar default 3);
|