• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 16. Sharing Data > Importing Text Files into Access

Importing Text Files into Access

To import text into Access, you might work with one of the two previously mentioned text files: delimited or fixed-width. As you learn more about other software applications, you’ll find that many can export data to a text file. Let’s demonstrate the import process by importing the two text files you created in the last section back into Access. Follow these steps:

In Access, select Get External Data from the File menu; then select Import from the resulting submenu.

In the Import dialog box, select Text Files (*.txt;*.csv;*.tab;*.asc) from the Files of Type control.

Select Catalogs.txt and click Import. You could use the Look In control to find files in another folder, but Catalogs.txt is in the default folder.

The wizard tries to interpret the incoming data and select the appropriate file type: delimited or fixed-width. It won’t always make the right choice, but this time, it does. The file is a delimited text file, so click Next.

In the next pane, check the First Row Contains Field Names option so the wizard will know what to do with the field names in the first row. (You might remember that you included the field names when you exported the data earlier.) When you do, the wizard removes the field names from the record display. The wizard also correctly identifies the delimiter, which in this case is a comma. Click Next.

You can import the data into an existing table or a new table. The default is to create a new table, and that’s what you want to do, so click Next.

You can rename the fields, apply an index, or specify a data type in the next pane. Don’t make any changes; just click Next.

Select the Choose My Own Primary Key option in the next window. The wizard defaults to the name field, which is what you want, so after selecting the primary key option, click Next.

In the final pane, change the default name to CatalogsDelimited, click Finish, and then click OK to clear the confirmation message. You already have a table named Catalogs, which is why you need to change the name.

In the Database window, click the Tables shortcut and open CatalogsDelimited.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint