Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text file returning incorrect no.of.lines
Message
From
13/06/2002 07:38:17
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
12/06/2002 15:08:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00667588
Message ID:
00667841
Views:
23
>Hello all
>
>I have a text file with 7 lines and 8th line is blank when i issue
>lcFile=Filetostr(cfile)
>numLines=Alines(aTextArray,lcFile)
>
>i get numlines as 8 how to get it to 7
>
>txs

Insert the line lcFile = alltrim(lcFile). This should trim empty lines at the end.

Another option is to write a small loop that check each line in aTextArray, whether it is empty: empty(aTextArray(i)).

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform