A
Alan B. Densky
I'm doing an import of a comma delimited file using DoCmd.TransferText
acImportDelim.
I have no control over the formatting of the file that I am importing, it is
comma delimited or nothing, and tab delimited wouldn't help me (that I can
see) anyway.
The problem arises when the csv file has a comma in the middle of it. For
Example: Jons Company, Inc.
The csv file loads correctly if I load it into Excel. But when I run my
import routine on it,
which uses the "DoCmd.TransferText acImportDelim," the import routine sees
the comma in the middle of the affected field, and splits that field
incorrectly, making all of the rest of the fields in the row shift one
column to the right. For some reason, it also adds quotes to the beginning
and end of every field that is imported into my table.
I don't want to re-engineer everything, because I've already done that
because of problems when linking to the data.
Does anyone know a simple way to loop through all of the fields in the csv
file, find any commas, and then get rid of a comma?
I can easily live with Jons Company Inc.instead of Jons Company, Inc.
Alan
acImportDelim.
I have no control over the formatting of the file that I am importing, it is
comma delimited or nothing, and tab delimited wouldn't help me (that I can
see) anyway.
The problem arises when the csv file has a comma in the middle of it. For
Example: Jons Company, Inc.
The csv file loads correctly if I load it into Excel. But when I run my
import routine on it,
which uses the "DoCmd.TransferText acImportDelim," the import routine sees
the comma in the middle of the affected field, and splits that field
incorrectly, making all of the rest of the fields in the row shift one
column to the right. For some reason, it also adds quotes to the beginning
and end of every field that is imported into my table.
I don't want to re-engineer everything, because I've already done that
because of problems when linking to the data.
Does anyone know a simple way to loop through all of the fields in the csv
file, find any commas, and then get rid of a comma?
I can easily live with Jons Company Inc.instead of Jons Company, Inc.
Alan