Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Import text.file
Message
From
20/07/2004 08:47:13
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
20/07/2004 04:56:25
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00926025
Message ID:
00926058
Views:
27
Hi Mohammed

>i want to import a text file,with one field,
>i want to divide this field to 5 or 6 fields,

Yourfile.txt
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
Import.prg
CREATE CURSOR c_Temp (cImport c(50), cField1 c(10), cField2 c(10), cField3 c(10), cField4 c(10), cField5 c(10))
APPEND FROM yourfile.txt TYPE sdf
REPLACE ALL ;
  cField1 WITH SUBSTR(cImport,1,10), ;
  cField2 WITH SUBSTR(cImport,11,10), ;
  cField3 WITH SUBSTR(cImport,21,10), ;
  cField4 WITH SUBSTR(cImport,31,10), ;
  cField5 WITH SUBSTR(cImport,41,10) ;
  IN c_Temp
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform