Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append from text file delimited
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Append from text file delimited
Miscellaneous
Thread ID:
00793848
Message ID:
00793848
Views:
54
Hi All
For data manipulation I have to import fixed width text files to VFP free table. It works ok when the each row width in the text file is less than 255 (CH). I use an empty table with single field 254 CH and then I use APPEND FROM textfile DELIMITED and then I use SUBSTR() to get the required fields to append another table. The example of prg file is as follows.

LOCAL lcdesc,lcitemno,lnqty,lnprice
IF ...
create table junkpos.dbf(allfields c(254))
ENDIF
SELECT 1
USE junkpos
SELECT 2
USE pos
SELECT 1
append from pos.txt delimited
go top
do while .not. eof()
lcdesc=SUBSTR(allfields,1,50)
lcitemno=SUBSTR(allfields,60,8)
.......
SELECT 2
APPEND BLANK
replace itemno WITH lcitem, itemdesc WITH lcitemdesc
SELECT 1
skip
loop
ENDDO

When the row width in the text file is more than 254 Ch then I can not get complete line of the text due to field width 254 CH. I want to save each text file line in a single record with more than 254 Ch.
Is there any help?
Regards,
Zaheer
Next
Reply
Map
View

Click here to load this message in the networking platform