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:
01197682
Vues:
23
>Thanks Bruce and Borislav
>
>It worked great !!
>
>However I forgot to mention the header line, which I omitted
>on the sample .txt file
>
>The header line does not have a comma, so I would like to skip it from the
>treatment
>
>Could you please insert a exception for the header line in your great code below ?
>
>TIA
lcFileStr= FILETOSTR([d:\source.txt]) && Change file name and path here
lnLines = ALINES(laLines,lcFileStr,0,CHR(10))
lcStr = []
FOR lnFor = 1 TO lnLines
    IF lnFor == 1 OR RIGHT(laLines[lnFor],1)==[,]
       lcStr = lcStr + laLines[lnFor] + CHR(13)+CHR(10)
    ELSE
       lcStr = lcStr + laLines[lnFor] + [ ]
    ENDIF
NEXT
STRTOFILE(lcStr,[d:\source1.txt]) && Change file name and path here
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform