If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > .csv file used for bcping has a comma for a value which is in double quotes -- prob

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-05-10, 15:15
rxg rxg is offline
Registered User
 
Join Date: Oct 2009
Posts: 8
Question .csv file used for bcping has a comma for a value which is in double quotes -- prob

Hi

I have a .csv file which contains some values with comma and those values are in double quotes.
When i bcp , that single value is becoming 2 values and is placed in the wrong field in the table.

How to avoid it .Pls help .
Table has 3 columns
.csv file (ie., input file) looks like this
example :-
wheat,"grown in , NY",Albany

Here these 3 values r going into the table's 3 columns as
first column takes :- wheat
second column takes :- grown in
third column takes :- NY

And Albany is not stored at all in the table .

How can i get 3 values in 3 columns ..

Any help is appreciated ..
Thank You .
Reply With Quote
  #2 (permalink)  
Old 01-06-10, 08:02
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,258
create a format file
use ," as first delimiter
and ", as 2nd delimiter
Reply With Quote
  #3 (permalink)  
Old 01-07-10, 10:37
rxg rxg is offline
Registered User
 
Join Date: Oct 2009
Posts: 8
Hi


Pls explain me with one record as an example.

I didnot understand . Sorry for the trouble.

Thank You once again.
Reply With Quote
  #4 (permalink)  
Old 01-08-10, 06:28
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,258
Follow this link
bcp in issue
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On