Import text file (1 Viewer)

prasadgov

Member
Local time
Yesterday, 21:49
Joined
Oct 12, 2021
Messages
124
Hi,

I receive RaR and PRTV files, which i save as text files.
I need to import them into Access table.
Currently, I paste this data into the table, which has one field. I then use the Mid function to read this data, parse it into various fields and then append it to the final table.
The PRTV file contains just one set of data with few lines. My question is, can I just import the entire data into the access field.

The text file looks as below
A1010307300000038824 2024178000010000038800000380 O 0000038824-000001S513000000388 06055JFD6OM 000000000 * 85173 01965137 SB 030000000 533SEG5

If I use TransferText, it prompts me for a delimiter.

I just want to dump the data as it is, into that one field (basically copy and paste)

Is that doable?

TIA
 
Use transfertext with no delimiter?
Or with a delimiter that won't be in the file, such as a pipe symbol, maybe.

You could treat it a fixed length text file, and position your own delimiters. I presume it must be fixed width. Then it will create multiple columns. If you already have a the parsing code, though, there's not a lot of point.
 
Using Open followed by Line Input will get you the whole record into a string variable that you can then parse. Pat Hartman gave you a reference to Open. Here is a reference for Line Input.


Then you can Close the file and dispose of it later.

 
I thought rar files were compressed files like zip files?
 
If I use TransferText, it prompts me for a delimiter.
Set the delimiter to a character that does not exist in your text, e.g. a pipe. Then the text file content can only be interpreted as a field, provided that there are no line breaks.
 

Users who are viewing this thread

Back
Top Bottom