Import text file (1 Viewer)

prasadgov

Member
Local time
Today, 09:23
Joined
Oct 12, 2021
Messages
50
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
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 14:23
Joined
Sep 12, 2006
Messages
15,798
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.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:23
Joined
Feb 28, 2001
Messages
27,646
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.

 

Gasman

Enthusiastic Amateur
Local time
Today, 14:23
Joined
Sep 21, 2011
Messages
14,718
I thought rar files were compressed files like zip files?
 

ebs17

Well-known member
Local time
Today, 15:23
Joined
Feb 7, 2020
Messages
2,064
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

Top Bottom