General information
Category:
Coding, syntax & commands
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only