How the Import Wizard Determines the Text File Type

Last reviewed: April 30, 1996
Article ID: Q128890
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

The Import Wizard assists you in creating a FoxPro table from another type of file, such as a text file. This article explains how FoxPro determines the type (fixed-length, comma-delimited, or tab-delimited) of text file you are importing.

MORE INFORMATION

Determining Records to Analyze

When you import a text file using the Import Wizard, by default it reads the first 50 records in the text file. To begin analysis at a different row, or perform analysis on all records, choose the Options button in the "Step 1a - Options" screen of the Import Wizard.

NOTE: The analysis of records cannot be manually interrupted.

Determining File Type

The following tests are performed in the order listed to determine the file's type:

  1. Do all records have the same length? If true, this is a fixed-length file.

  2. Do all records have the same number of commas? If true, this is a comma-delimited file.

  3. Do all records have the same number of tabs? If true, this is a tab-delimited file.

  4. Do all records have the same number of semicolons? If true, this is a semicolon-delimited file.

  5. If none of the previous tests are true, the Import Wizard assumes the file to be a fixed-length file, using the length of the longest record in the 50-record sample as the record length.

Determining File Structure

Once the file's type is determined, the following tests are performed to determine its structure.

  • Fixed-length Files: Each record is analyzed to determine potential column breaks, by tracking the locations in each record where a space is followed by a non-space character. When 75% or more of the records have this transition from a space to non-space character in the same location, that location is assumed to be a column break. This is how the Import Wizard decides where to place the default column breaks displayed in Step 1a.
  • Delimited Files: Each field in all records is analyzed to determine the maximum field lengths. All fields are assumed to be character unless a field is wider than the maximum character field width, in which case the field is assumed to be a memo field.


Additional reference words: 3.00 VFoxWin semi-colon
KBCategory: kbtool kbinterop
KBSubcategory: FxtoolWizother


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.