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:
01197682
Views:
24
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform