Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Text file returning incorrect no.of.lines
Message
De
13/06/2002 07:38:17
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
12/06/2002 15:08:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00667588
Message ID:
00667841
Vues:
22
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform