Problem when trying to bcp csv file with Double Quotes to sybase table

Problem when trying to bcp csv file with Double Quotes to sybase table

Post by Mustafa aldwir » Wed, 20 Jun 2001 23:41:11



Hello All,

I have several csv files which I need to import into tables on a regular basis.However, some of the fields in the csv file has a text qualifier eg "field1","field2","field3" etc
If you use the import facility in Access it can handle a text qualifier with no problems at all, however it seems that bcp has no provision for text qualifier's, it can only handle csv files in the format :
field1,field2,field3,field4
So if you atempt to bcp in a file with text qualifiers, the quote marks will get imported into the fields along with the data. Is there a way around this to get bcp to deal with text qualifiers or will I have to
remove them from the files first (not desirable).

thanks in advance.

-Mustafa

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

 
 
 

Problem when trying to bcp csv file with Double Quotes to sybase table

Post by Paurav Vor » Thu, 21 Jun 2001 01:07:16


Look at the post "Bulk Insert".
The best way is to use Import wizard which
has TextQualifier option

--
Paurav "Please Reply To NewsGroup"

Quote:> Hello All,

> I have several csv files which I need to import into tables on a regular

basis.However, some of the fields in the csv file has a text qualifier eg
"field1","field2","field3" etc
Quote:> If you use the import facility in Access it can handle a text qualifier

with no problems at all, however it seems that bcp has no provision for text
qualifier's, it can only handle csv files in the format :
Quote:> field1,field2,field3,field4
> So if you atempt to bcp in a file with text qualifiers, the quote marks

will get imported into the fields along with the data. Is there a way around
this to get bcp to deal with text qualifiers or will I have to
Quote:> remove them from the files first (not desirable).

> thanks in advance.

> -Mustafa

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!