Well, my problem is that when reading the file it doesn't recognize all the columns it should.
I'm using ODBC for text.
The data inside the file is delimited with |, the first line of the file is:
---1st scenario---
2005|01|Book of "Roses" |Adam Benson |46
the fields are year,month,book,name,age.
But when I read the file only 3 columns are recognized.
And
|Book of "Roses" |
is truncated to
Book of
---2nd scenario---
2005|01|Children |Roger Grand |52
2005|01|Book of "Roses" |Adam Benson |46
the fields are year,month,book,name,age.
When I read the file 5 columns are recognized
But when I read the information from the second line.
the third field gets truncated to
Book of
And the 4th and 5th fields are DBNull.
I've already read the posts:
http://p2p.wrox.com/topic.asp?TOPIC_ID=4280
Here indicates the conneciton string and the schema.ini files, and:
http://p2p.wrox.com/topic.asp?TOPIC_ID=4693
Inside here they tells how to get the Schema.ini file through ODBC Sources inside Administrative tools wich for the 1st scenario it only detects 3 columns and not the 5.
Please I'm really going crazy with this.
Futher findings:
I've found that instead of 1 " there are 2 " in that specific lines, everyuthing works fine.
Then I supposed I should change every " into "", but what would happen if in my File there is this line:
2005|01|"Children" |Roger Grand |52
2005|01|Book of "Roses" |Adam Benson |46
And changing the " into "" the result would be:
2005|01|""Children"" |Roger Grand |52
2005|01|Book of ""Roses"" |Adam Benson |46
The 3rd value of the 1st is empty or null, i'm not sure
It would be incorrect.
And the 3rd value of the 2nd line would be:
Book of "Roses"
It would be correct....
I think i'm getting clouse to the solution but I still can't get it right but then something happens.... :(
Comment:
When opening the file with Excels it works fine, using the delimiter | with this line
2005|01|Book of "Roses" |Adam Benson |46