particular schema.ini

User avatar
sal21
PlatinumLounger
Posts: 4364
Joined: 26 Apr 2010, 17:36

particular schema.ini

Post by sal21 »

Code: Select all

[1241ITA_391421.csv]
ColNameHeader = TRUE
CharacterSet = ANSI
Format = Delimited(;)
this is my schema ini into the same dir where is the csv file.

i need to set the 3th line to read the header of records and all data from csv file....

in effect the structure of my csv is similar:

test nr_4587 09012012 (is the name of report)

sfg;oio;sdvf (are the header of columns)
1245 ;4587
1457 ;788

....
ecc

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: particular schema.ini

Post by HansV »

I don't understand what you want. A schema.ini file doesn't read data, it only specifies the format.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: particular schema.ini

Post by HansV »

See Procedura: aggiungere una definizione dello schema a un'origine dati file di testo for a desctiption of the structure of a schema.ini file.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: particular schema.ini

Post by HansV »

Sal, I got your e-mail. You can't specify in a schema.ini file that the first n rows should be skipped - also see SCHEMA.INI set line 32 of text file from almost two years ago.

You must either delete the rows that you want to skip, or read the file line by line.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4364
Joined: 26 Apr 2010, 17:36

Re: particular schema.ini

Post by sal21 »

HansV wrote:Sal, I got your e-mail. You can't specify in a schema.ini file that the first n rows should be skipped - also see SCHEMA.INI set line 32 of text file from almost two years ago.

You must either delete the rows that you want to skip, or read the file line by line.
OK!
But if i need to delte the first 3 row i nedd read and write into new file? or not?
or is possible to delete the first 3 rows with a code?

Other way:
..."or read the file line by line"

In this case, i think, i need to split by ";" each lines, or not? if yes have an example of code?

Tks!


NOTE:
Your mind is a Dip Blue IBM Server, peraphs... you remember my post old 2 year ago?

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: particular schema.ini

Post by HansV »

Google is my friend... :grin:

To delete the first three lines, you can read the existing file line by line, and write them to a new file, skipping the first three.
Or open the text file in Excel, and delete the first three rows there.
Best wishes,
Hans