Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing break lines from a .txt file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01197525
Message ID:
01197687
Vues:
16
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform