Data Import & Export

Import Text Files with Multiple Header Sections into Microsoft Access

Kushani NimanthikaKushani Nimanthika Nov 27, 2026 869 views

Question details

Import trade records from a text file that contains general and trade-specific header sections.

Import Text Files with Multiple Header Sections into Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Each trade record must include fixed values supplied by preceding header sections.
Observed behavior
The file cannot always be linked directly in its current layout because header values must be repeated for each resulting trade record.
Before you start

Inspect a sample file to identify how general headers, trade-specific headers, and trade records are distinguished. List the destination Access fields and determine when each header value changes or should be cleared.

Solution 1Recommended

Restructure the text file before importing it into Access

Use a spreadsheet to create one complete row per trade when the file can be prepared manually.

1
Open the text data

Open the text file in Excel or another spreadsheet application. Use its text import options to select the correct delimiter or fixed-width layout.

2
Identify header values

Add columns for the general and trade-specific values required by the Access table. In each column, enter or calculate the applicable header value for every trade row, changing or clearing it when a new section requires it.

3
Create a flat table

Copy the completed columns and use Paste Special > Values. Remove the separate header-section rows, leaving one field-name row followed by one complete row per trade.

4
Save and import

Save the flat table as a CSV file. In Access, choose External Data > New Data Source > From File > Text File, select the CSV, and follow the import wizard to map its fields to a new or existing table.

5
Check the records

Open the destination table in Access and compare record counts and representative trades with the source file, especially at section boundaries.

Restructure the text file before importing it into Access
Keep values with the correct section: Do not fill a header value past the point where it changes or becomes invalid. The rules for carrying values forward depend on the source file's layout.
Free Microsoft Office alternative

Prepare trade data in WPS Spreadsheets

WPS Office is a free, lightweight Office alternative with a familiar interface. Use WPS Spreadsheets to organize trade rows and carry header values into columns before exporting a flat file. It does not replace the Access import process or fix Access linking limitations.

Organize multi-section trade data into a spreadsheet table before importOpen and edit Microsoft Excel formats, including XLSXUse a familiar spreadsheet interface for an easier move from Microsoft OfficeSave prepared data as CSV for import into Access
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I link the original text file directly to Access?

The file has different kinds of rows: general headers, trade-specific headers, and trade records. A standard text import expects a consistent row structure, so the relevant header values may need to be added to each trade row first.

How do I import the prepared CSV into an existing Access table?

In Access, choose External Data > New Data Source > From File > Text File, select the CSV, and choose the option to append records to an existing table. Check the field mapping and data types in the wizard.

What should happen when a new header section starts?

Update the values carried into subsequent trade rows and clear any values that no longer apply. Check the first and last trade in each section against the source file.

Can WPS Office import the original file directly into an Access database?

WPS Spreadsheets can help prepare a flat CSV, but the CSV must still be imported through Access or a separate database routine.