Reading Data From Text File 
Author Message
 Reading Data From Text File

Don't know if this is the place to post this, but I'll give it a shot.

I'm importing a text file into Access97 database, but before I import it,
I'm cleaning up the data.  I'm using code similar to the following:

Open sTempFile For Input as 1
Open sCleanFile For Output as 2

Do While Not EOF(1)
    Input #1, var1, var2, var3,var4,var5
    'more code goes here to make the variables contain the data I want
    Print #2, var1, var2, var3, var4, var5
Loop
Close

When I run the code, it always stops at one certain record.  I believe it is
the 12,402 record out of 14,500 or so records.  If I make a copy of the
input file, delete half the records from each, and run the code twice to get
all the data (of course I have to rename the output file so the first run
doesn't get overwrote), all the data gets cleaned up so I can use it.

Any ideas what could be causing this to happen??

Thanks in advance,
Toddo



Mon, 20 May 2002 03:00:00 GMT  
 Reading Data From Text File
Yes I have an idea why this could happen.
If your input file (TempFile) is a dos text file, and it is an export file
from an application, then it *may* be an EOF character in the MIDDLE of the
file (I do not know why) and naturally Access stops reading because it
reached an EOF character (before the original and expected one in the
physical end of file).
Read my message with this problem in the same group.
Hope I helped a little
Takis

Quote:
>Don't know if this is the place to post this, but I'll give it a shot.

>I'm importing a text file into Access97 database, but before I import it,
>I'm cleaning up the data.  I'm using code similar to the following:

>Open sTempFile For Input as 1
>Open sCleanFile For Output as 2

>Do While Not EOF(1)
>    Input #1, var1, var2, var3,var4,var5
>    'more code goes here to make the variables contain the data I want
>    Print #2, var1, var2, var3, var4, var5
>Loop
>Close

>When I run the code, it always stops at one certain record.  I believe it
is
>the 12,402 record out of 14,500 or so records.  If I make a copy of the
>input file, delete half the records from each, and run the code twice to
get
>all the data (of course I have to rename the output file so the first run
>doesn't get overwrote), all the data gets cleaned up so I can use it.

>Any ideas what could be causing this to happen??

>Thanks in advance,
>Toddo



Tue, 21 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP!!!! Question about Read Data From Text File

2. Reading Data from Text file

3. Read Data from text file?

4. Read Data from Text File

5. reading data from text files

6. Read data from text files (or not)

7. File Association/reading text file data

8. Reading from a text file and writing toa text file from Vis Bas 6.0

9. Max. Size when reading a text data file

10. QBasic: Reading specific data from a text file?

11. NEED TO READ DATA FROM A TEXT FILE AND PUT IT INTO AN ACCESS TABLE

12. Suggestions in reading text file data.

 

 
Powered by phpBB® Forum Software