Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Import text.file
Message
From
20/07/2004 16:36:02
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00926025
Message ID:
00926302
Views:
10
hi,

CREATE table cImprt (Fld1 C(10), fld2 C(10), fld3 C(10), fld4 C(10), fld5 C(10))
cParseChar = CHR(13)+CHR(10)
my_txt = FILETOSTR("ala")
all_lines = ALINES(txtLines, my_txt, cParseChar)

WAIT WINDOW all_lines && To check how many lines ALINES() returns
***i can see 5 records, yes this is my table
**when browse i see one record

SELECT cImprt
currentField = 0

FOR i = 1 TO all_lines
currentField = currentField + 1
IF currentField > 5
currentField = 1
ENDIF
IF currentField == 1
INSERT INTO cImprt (Fld1) VALUES (txtLines[i])
ELSE
fldname = FIELD(i, "cImprt")
REPLACE &fldname WITH txtLines[i]
ENDIF
ENDFOR
GO TOP
brow
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform