Creating Comma-Delimited File That Retains Trailing SpaceID: Q111913 2.00 2.50 2.50a 2.50b | 2.50 2.50a 2.50b 3.00
The information in this article applies to:
SUMMARYWhen you are copying a FoxPro database to a comma-delimited file using the COPY TO <filename> TYPE DELIMITED command, the trailing blanks of each field are removed. Occasionally, the entire file, including any trailing blanks found in a field, needs to be copied to an ASCII file, but no options exist for the COPY TO command to accomplish this. However, you can use low-level file functions to transport the entire contents of every field from a database into a comma-delimited ASCII file.
MORE INFORMATIONThe following code uses low-level file functions to read the CLIENTS.DBF sample database file and place the characters and trailing blanks of each field in a comma-delimited ASCII file named TEST.TXT:
NOTE: By default, the FPUTS() function expects character type data in the
fields. Therefore, in order to use numeric and date fields, add the STR()
and DTOC() functions to convert the respective fields to character type
data. Adding additional parameters to the STR() function preserves the
decimal places in the numeric fields.
REFERENCES"Language Reference," version 2.5, pages L3-528 to L3-530, L3-496, L3-498 to L3-499 Additional reference words: VFoxWin 3.00 FoxDos FoxWin 2.00 2.50 2.50a 2.50b spaces padding KBCategory: KBSubcategory: FxprgGeneral
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |