Hi, probably a common topic but search has not been very successful... hope to get some tips here.
I use Access 2003 (soon 2010) to import a .txt file with 8 million lines, they are short so its around 500 MB.
It has no delimiters, instead the first letter in each line tells me how it is formated and which information to expect, which means i have to do about 5 TRIM operations on each line to extract the "fields" (see example below).
I used to open the file with ADO, read each line and write the appropriate parts of the string into fields of a regular table, but this has become slow somehow, like 30+ minutes.
I also tried to read the entire file into a single-field table into Access and then do transition into the fields of a second table within Access, which turned out to be REALLY REALLY slow.
Example:
A NewYork 12345
B abc
C 1 aa
C 2 bb
C 3 cc
C 4 dd
A Sydney 123456
B abc
C 1 aa
C 2 bb
C 3 cc
C 4 dd
...etc
The data is dependant, the array operations for this might also be slow... ?? e.g. there can be 1 "A" line followed by 20 "B" lines with each "B" segment containing another 50 "C" lines... what i need in the end is a table like this:
New York; 12345; abc; 1; aa
New York; 12345; abc; 2; bb
New York; 12345; abc; 3; cc
New York; 12345; abc; 4; dd
....
etc
Any tips how to get the best speed for this kind of operation ?
Thanks for help,
Z
I use Access 2003 (soon 2010) to import a .txt file with 8 million lines, they are short so its around 500 MB.
It has no delimiters, instead the first letter in each line tells me how it is formated and which information to expect, which means i have to do about 5 TRIM operations on each line to extract the "fields" (see example below).
I used to open the file with ADO, read each line and write the appropriate parts of the string into fields of a regular table, but this has become slow somehow, like 30+ minutes.
I also tried to read the entire file into a single-field table into Access and then do transition into the fields of a second table within Access, which turned out to be REALLY REALLY slow.
Example:
A NewYork 12345
B abc
C 1 aa
C 2 bb
C 3 cc
C 4 dd
A Sydney 123456
B abc
C 1 aa
C 2 bb
C 3 cc
C 4 dd
...etc
The data is dependant, the array operations for this might also be slow... ?? e.g. there can be 1 "A" line followed by 20 "B" lines with each "B" segment containing another 50 "C" lines... what i need in the end is a table like this:
New York; 12345; abc; 1; aa
New York; 12345; abc; 2; bb
New York; 12345; abc; 3; cc
New York; 12345; abc; 4; dd
....
etc
Any tips how to get the best speed for this kind of operation ?
Thanks for help,
Z