Import text file and copy text on 1 row to each row (Macro)

PocketNeo

Board Regular
Joined
Jun 10, 2002
Messages
139
I have a very large fixed-length file (400 chars in length). Each row has a 2-character indicator in position 1-2. On the first row of the file, that begins with HH, it is followed by a field that is 16 digits long. This 16-digit value needs to be copied to position 401-416 on all rows, including HH.

Since I can't do this in Excel due to the row count limitation, how can I do this in Access?
 
If you look back about two or three posts back from me, I spelled out what both tables should look like in the form of fields and field lengths. I did not say that all fields should be text, but they should be.
tblRawData has ALL the raw data in it from your file. Please note that the table tblRawData has 400 bytes for each record.
tblRawData16 will be empty before you run the code I suggested.
The code will copy the 16 bytes from positions 3 - 18 of record "HH" into positions 401-416 of ALL records.
I thought I said what the layout of the records was. 2 bytes, 16 bytes, and 382 bytes. That should add up to 400 bytes for the length of your raw data.
That is what you wanted isn't it?
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,214,983
Messages
6,122,591
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top