ACC: Text Import Wizard Doesn't Import Data CorrectlyLast reviewed: August 29, 1997Article ID: Q149946 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you import certain text files, using the Import Text Wizard, you may see one of the following symptoms:
CAUSECertain text files are created with only a Chr(10) (linefeed character) at the end of each line to indicate a new record. The Import Wizard expects a Chr(13) and a Chr(10) to recognize the end of a record and the character codes MUST be in this order. Because neither Microsoft Access 7.0 nor 97 see this combination, they interpret the imported data as one record. Microsoft Word and Microsoft Access 2.0 on the other hand, recognize Chr(10) to indicate the end of a record. NOTE: Unix text files use the line feed character at the end of the line. OS/2 and MS-DOS text files use the line feed and the carriage return together at the end of the line.
STATUSThis behavior is by design.
RESOLUTIONUse one of the following three methods to work around this behavior.
Method 1Insert a Chr(13) after each record using a text editor (such as NotePad).
Method 2Use Microsoft Word 6.0 or later to search for paragraph marks and replace them with carriage returns/line feeds. For more information about finding and replacing paragraph marks in Microsoft Word, search the Microsoft Word Help Index for "find and replace," and then "Examples of special characters and document elements you can find and replace."
Method 3Use the following steps to create a Visual Basic for Applications function that checks to see if a file contains only a CHR(10) at the end of each record and, if so, replaces it with a CHR(13) + CHR(10) so that Microsoft Access will be able to successfully import the records. This part of the article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.
REFERENCESFor more information about importing, search the Help Index for "importing data," or ask the Microsoft Access 97 Office Assistant.
|
Additional query words: line feed return delimiter EBCDC UNIX OS/2 DOS
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |