Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing break lines from a .txt file
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01197525
Message ID:
01197687
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
>Borislav
>
>Though both codes are valuable codes, Bruce's code suits better for me
>Could you or Bruce please add the line to skip the header on Bruce's Code ?
>
>Thank very much
>
>Moises

Not tested:
LOCAL lcInStr, lcOutStr

lcInStr = FILETOSTR('InFile.txt')

* Tokenize good CRLF
lcOutStr = STRTRAN(lcInStr, ',' + CHR(13) + CHR(10), '|')
* Get rid of unwanted CRLF 
lcOutStr = STRTRAN(lcOutStr, CHR(13) + CHR(10), '', 2)
* Replace tokens
lcOutStr = STRTRAN(lcOutStr, '|', ',' + CHR(13) + CHR(10))

STRTOFILE(lcOutStr, 'OutFile.txt')
Must work with VF8 and 9 not sure about previous versions.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform