Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove quotation marks from CSV data?

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
GB
Hi,

I am producing a DTS package that uses a Bulk insert tool to populate a table from a CSV file.

I can get the data to be populated, but all of the data has quotation marks around it, for example:

col1 col2 col3 col4
"someValue" "123" "blah" "asd"

I can only get DTS to parse the csv file in 1 combination of column, and line delimiters, so am not sure if this is the problem. (I think the csv file is produced from a Linux system so not sure if this has anything to do with it?).

I basically want the data to be like this:
col1 col2 col3 col4
someValue 123 blah asd

How can i do this?

THanks,

MrPEds

 
If it is in a DTS package you could create an ActiveX task to utilize FSO and strip them directly from the csv file. or if not in a dts package then you could probably do it with use of a bat or some kind of script file. Another alternative would be to load the records into a staging table and then use a replace() function as you process the reords although this may defeat the purpose of using bcp.

"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top