Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Formatting
Message
De
30/03/2004 12:07:05
 
 
À
29/03/2004 09:11:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00890388
Message ID:
00890860
Vues:
17
>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]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform