Import or link a delimited or fixed-width text file
Note You can link a table only in a Microsoft Access database, not a Microsoft Access project.
Important Before you import or link data from a delimited text file or fixed-width text file, make sure that the file has the same type of data in each field and the same fields in every row.
- Open a database, or switch to the Database window for the open database.
- To import data, on the File menu, point to Get External Data, and then click Import.
To link data, on the File menu, point to Get External Data, and then click Link Tables.
- In the Import (or Link) dialog box, in the Files Of Type box, select Text Files (*.txt;*.csv;*.tab;*.asc).
- Click the arrow to the right of the Look In box, select the drive and folder where the file is located, and then double-click its icon.
Important If you link to a file on a local area network, make sure that you use a universal naming convention (UNC) path, instead of relying on the drive letter of a mapped network drive in Windows Explorer. A drive letter can vary on a computer, or it may not always be defined; whereas, a UNC path is a reliable and consistent way for Microsoft Access to locate the data source that contains the linked table.
- Follow the directions in the Import Text Wizard dialog boxes. Click Advanced to create or use an import/export specification.
Notes
- Although you usually create a new table in Microsoft Access for the data, you can append the data to an existing table as long as the first row of your text file contains matching field names.
- If importing a text file takes an unexpectedly long time, it might be because many errors are occurring. To cancel importing, press CTRL+BREAK.
- In a fixed-width text file, you can ignore fields at the end of a record that contain no data. In addition, the last field with data in the record can be less than the maximum width.
- If all the records in a fixed-width text file are the same length, there can be an embedded row separator (such as a carriage return and linefeed) in the middle of a record. If the records aren't all the same length, embedded row separators should not be used because Microsoft Access will treat the embedded row separator as the end of the record.