How do I remove quotes from the column headers in a flat file with SSIS?

Viewed 1783

I've got a CSV file where all column headers and values are wrapped in quotes ("). In the Flat File Connection Manager Editor I've specified " in the Text qualifier field. That takes care of all the quotes around data values but it doesn't seem to affect the quotes around the column headers. Is there a way to strip the quotes from the column headers as well?

2 Answers

If it's a source, then the column names are unfortunately "Col1". The other option would be to uncheck file has a header row and skip 1 row in the flat file connection manager. Then you'd be able to rename the columns as you desire.

As I think about this, you might be able to manually change the column names in the Flat File Connection Manager to remote the double quotes. And I guess there's also an option to define the column name in the Flat File Source within your data flow so the FFCM would specify it's "Col1" and you can map it to a friendlier name like Column1

You can convert your csv file into a text file and then load that one. After you load the file, in the Text Qualifier put "
this should take care of both the double quotes around your header and your column values.

Related