PRB: How to Remove ^M (CHR(13)) from FoxPro UNIX Text FileID: Q142285 2.60 UNIX kbinterop kbprb The information in this article applies to:
SYMPTOMSFoxpro for UNIX places a carriage return/line feed pair ( 0D 0A in hex ) at the end of lines in text files that were created by commands such as REPORT FORM xxxx TO FILE yyyy in addition to any printer codes that might be appropriate (if _PDSETUP contains a valid printer driver name). Not all UNIX programs are designed to accommodate the carriage return character.
CAUSEFoxpro expects the carriage return/line feed pair to be a proper line termination indicator and thus places it at the end of lines in text files it creates.
WORKAROUNDA program, such as the example below, may be used to read the text file after it is created by Foxpro and then output a new file, devoid of the ^M (CHR(13)) terminator for use by other UNIX programs. * begin strip13.prg * Created to strip the ^M's (chr(13)) out of .TXT files that are * routinely added by Foxpro at the end of each line. PARAMETER out_fname IF .NOT. FILE(out_fname) ELSE
ENDIF
* End of Strip13.prg
STATUSThis behavior is by design. FoxPro expects the carriage return/line feed pair to be a proper line termination indicator and thus places it at the end of lines in text files it creates.
MORE INFORMATION
Steps to Reproduce Behavior1. Create a simple REPORT FORM using a simple data table. 2. Run the report using this syntax:
3. Examine the file Test.txt using the UNIX vi editor. You will notice what
Additional reference words: 2.60 FoxUnix
KBCategory: kbinterop kbprb
KBSubcategory: FxinteropGeneral
|
|
Last Reviewed: January 16, 1996 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |