Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing break lines from a .txt file
Message
From
21/02/2007 10:18:40
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01197525
Message ID:
01197609
Views:
15
Hi Moises,

Borislav gave you one way, here is another:
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), '')
* Replace tokens
lcOutStr = STRTRAN(lcOutStr, '|', ',' + CHR(13) + CHR(10))

STRTOFILE(lcOutStr, 'OutFile.txt')
Bruce

>It converts all lines... :(
>
>But there is not a comma in the final of the troubled line
>
>Could I create an exeption like:
>
>Convert only the lines that do not have the comma on its final ?
>
>Moises
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform