Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending table with delimited by commas.
Message
De
07/08/1999 13:57:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00250332
Message ID:
00251108
Vues:
14
>I want to append a text file which is delimted by commas. I have a problem with consecutive commas. I want the extra commas to be acknowledged as a place holder. How do I go about doing this?
>
>Example: John,,Smith
>if I had a table with first,MI,Lastname. I want the last name to go into the proper field. As is, it would be placed in the MI field automatically, because the double commas are being ignored.
>
>TIA,
>
>Jim

Hi Jim:

We do this kind of stuff every night on some major file imports into FP/VFP. Normally you would want to use the 'standard' 'delimited' format, which in reality is 'comma separated, quotes delimited' -- not as the syntax would have you believe. To avoid problems with any commas that might be embedded within a field, enclosing each field in quotation marks is advised, ie:

"John",,"Smith" would import just fine in your example by invoking:

APPEND FROM xxx DELIMITED WITH "

If you might need to consider some other embedded characters, you can specify a different delimiter. One of our major imports uses DELLIMITED WITH ~ (tilde), for that reason.

HTH

Rob
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform