The information in this article applies to:
SUMMARY
Microsoft Excel versions 3.0 and 4.0 provide an add-in macro called
Flatfile.xla. You can use this macro to export all or part of a worksheet
to a text file in the "flat file" format.
MORE INFORMATION
The flat file format is used to create text files that you can open in
other programs that only work with text data. For example, this format is
required by mainframe programs and is often necessary for government
reporting. To create a flat text file, use the method that is appropriate
for your version of Microsoft Excel.
Creating a Flat Text File in Excel 5.0 and LaterTo create the file, follow these steps:
Issues with Space-Delimited Format in Microsoft Excel 5.0 or LaterThe following sections contain information about behavior when exporting the data.Issue 1: 240 Character Limit Formatted Text (Space Delimited) (.prn) files have a limitation of 240 characters per line. For additional information, please see the following article in the Microsoft Knowledge Base: Q131554 : XL: Formatted Text (.prn) Limited to 240 Characters Per Line Issue 2: Numeric Data Formatted with Accounting Format Lost Numeric data may be lost in fields that are formatted with the Accounting format because the "Formatted Text (Space delimited)(*.prn)" file format does not support the number formats in the Accounting formatting category. ARTICLE-ID: Q178128 : XL: Numeric Data May Be Lost When Saving File in PRN Format Creating a Flat Text File in Excel Versions 3.0, and 4.0 with Flatfile.xlaTo create the file, follow these steps:
Issues with Flatfile.xlaThe following sections contain information about the alignment and number formatting, column widths, and fonts in the exported data.Issue 1: Alignment and Number Formatting with Flatfile.xla: If you use the Export command to export data from your worksheet, you have the ability to keep the alignment and number formatting of the cells you are exporting. You also have the ability to use General alignment and number formatting for all data. If you use General alignment and number formatting, text data is aligned to the left, and numeric data is aligned to the right. Formatting, such as currency or custom number formatting, is not saved.
Issue 2: Column Widths with Flatfile.xla: The column width in your text file is equal to the whole number portion of the column width for the selected cells. For example, if the column width is 12.45, the column in the text file will be 12 characters wide. Any characters beyond the twelfth character in a cell are not included in the text file. Before you export data, make sure that the columns in the worksheet are wide enough to accommodate all of the characters in the cells you want to export. Issue 3: Fonts with Flatfile.xla: If your worksheet is formatted with proportional fonts (for example, Times New Roman or MS Sans Serif), you may need to increase the width of the columns to ensure that all of the data is exported properly. With proportional fonts, some characters are narrower than others are; therefore, more characters may be in a cell than the number that is indicated by the column width. As a result, these characters are cut off when you export the data (see "Issue 2: Column Widths with Flatfile.xla"). To ensure that all of the data is exported properly, format all of the data with a non-proportional font, such as Courier, or experiment with various column widths until all of the data is exported. REFERENCES
For more information about this issue, please see the following resources:
Additional query words: 3.0 XLA fixed length xl font export flatfile space delimited ascii ansi limitation line width
Keywords : xlloadsave xladdin |
Last Reviewed: May 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |