>Very good rotine
>
>
> However it go also to blank lines and process them
>
> Is there anyway to skip blank lines ?
>
> TIA
>
> Moises
You decide how to process each array element.
Sergey's code included:
...
FOR i=1 TO ALEN(laLines)
STRTOFILE(laLines[i] + myvariable + lcCrLf, lcNewTextFile, .T.)
ENDFOR
Each array element represents one line of the original text-file. So, you can simply add the condition like this:
FOR i=1 TO ALEN(laLines)
if not empty(laLines[i]
STRTOFILE(laLines[i] + myvariable + lcCrLf, lcNewTextFile, .T.)
endif
ENDFOR
Please note that the array approach is limited by the VFP limit of 65,000 elements per array, that is, 65,000 rows.
Other methods are available for longer files, too.
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)