Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Formatting
Message
From
30/03/2004 12:07:05
 
 
To
29/03/2004 09:11:22
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00890388
Message ID:
00890860
Views:
18
>I am receive my data in a text file in the following format:
>"5365-00-384-6859","SPACER","","EA|EA","1.50|1.50"
>
>Is there a way I can upload this data into a table. It appears that the brackets are causing a problem when I am uploading using the typical:
>appen from myfile.txt type sdf delimited

Ok Jeffrey -
i read all of your stuff -
i suggest a two table approach .
first table has the input structure from your raw ascii file, so use
append from myfile.txt type CSV to get the data.

second table would look just like the first one, but would have
the proper field type and size for the two data elements that contain the PIPE bar |

then after first table is filled,
do scan..endscan on the first table ...
similar to
scatter memvar
lnpos = iif(occurs("|",m.unit),at("|",m.unit)-1, len(m.unit)) && i may have the params backwards
m.unit = substr(m.unit,1,lnpos
lnpos = iif(occurs("|", m.price),at("|",m.price)-1, len(m.price))
m.price = val(substr(m.price,1,lnpos))
insert into tabletwo from memvar

*--
this would clean up your data, and NOT worry about the size of the
proper UNIT of Measure NAME or the price.

lemme know how that works out for you .
mondo regards [Bill]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform