ACC1: How to Import Fixed-Width Text FilesLast reviewed: April 2, 1997Article ID: Q94107 |
The information in this article applies to:
SUMMARYThis article describes the fixed-width text file format and explains how to import this type of file.
MORE INFORMATIONA fixed-width text file in Microsoft Access is a file that contains records of a fixed, consistent width. The data fields in each record begin at fixed offsets from the beginning of the record. You cannot import files that have variable length records that do not contain field separators (for example, commas or tabs). These files are not fixed-width text files. To import this kind of file, you need to first process the file using an editor to insert field separators or to turn the file into a true fixed-width text file by, for example, adding spaces to each record to make all records the same width (number of characters). Microsoft Access imports fixed-width text files by casting a record template into the file at calculable offsets. It uses the offsets to determine the logical beginning of each new record. Microsoft Access determines the logical record width by scanning the first data record of the file to locate the first carriage return and line feed (CR/LF). It assumes that the first CR/LF marks the end of the first record (see point three later in this article). The data fields defined in the template come from the information you supplied when you set up the import/export specification. Microsoft Access uses the template to extract the individual field values. Then it enters the field values into table and advances the template to the next record. To import fixed-width text files successfully, they must meet the following conditions:
REFERENCESFor more information, search for "Fixed-width text files" using the Microsoft Access Help menu. Also, see the Microsoft Access "User's Guide," version 1.0, Chapter 4, "Importing, Exporting, and Attaching," pages 72-85.
|
Additional query words: import/export forms Macros Spec
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |