shawnwmorris
Programmer
I have been attempting with VFP 9.0 to parse a tab-delimited file. The file contents look like this:
Policy 1 LocNum 1 Address 1 City 1 State 1 Zip 1
Policy 2 LocNum 2 Address 2 City 2 State 2 Zip 2
Policy 3 LocNum 3 Address 3 City 3 State 3 Zip 3
Policy 4 LocNum 4 Address 4 City 4 State 4 Zip 4
Policy 5 LocNum 5 Address 5 City 5 State 5 Zip 5
I am trying to learn how to access individual "fields" in the data
My code doesn't work correctly (not suprised, I am a newbie) My attmepts give me all of the data for 1 row repeated for the number of rows in the file. Here is my code:
I would appreciate any help to point me in the right direction.
Policy 1 LocNum 1 Address 1 City 1 State 1 Zip 1
Policy 2 LocNum 2 Address 2 City 2 State 2 Zip 2
Policy 3 LocNum 3 Address 3 City 3 State 3 Zip 3
Policy 4 LocNum 4 Address 4 City 4 State 4 Zip 4
Policy 5 LocNum 5 Address 5 City 5 State 5 Zip 5
I am trying to learn how to access individual "fields" in the data
My code doesn't work correctly (not suprised, I am a newbie) My attmepts give me all of the data for 1 row repeated for the number of rows in the file. Here is my code:
Code:
IF ALINES( laFile, FILETOSTR("c:\temp\abc.txt")) > 0 && Load to array, by line. If textfile is not empty
FOR lnLine = 1 TO ALEN( laFile,1) && Do for each line of the file
?laFile(lnLine,2)
ENDFOR
ENDIF
I would appreciate any help to point me in the right direction.