Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Treating lines in a string
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00807738
Message ID:
00807792
Views:
19
I set up as below

But the problem it's replacing all lines
Even the lines that does not contain "http://www"



lcStr = FILETOSTR("header3.htm")

DIMENSION laLines[1]
ALINES(laLines, lcStr)
lcNewTextFile = "header3b.htm"
lcCrLf = CHR(13) + CHR(10)
ERASE (lcNewTextFile)
FOR i=1 TO ALEN(laLines)
if not empty(laLines[i]) && skip blank lines
IF ("http://www" $ laLines[i])
STRTOFILE(' '+ lcCrLf, lcNewTextFile, .T.)
endif
endif

ENDFOR
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform