Question

I have some CSV files that appear OK in Notepad and Excel however seem to have extra line-feeds in them when I view them in VS2010 or Notepad++. When I attempt to process them in SSIS, the files fail with errors like this:

Error: 0xC0202055 at Merge Files, Interface [225]: The column delimiter for column "Column 48" was not found.

Here's a truncated example (there's about 50 columns, and the line-wrap appears to wrap randomly at the same position):

enter image description here

The questions are: how does Notepad and Excel open these files OK (and seemingly ignore the line-feeds)? Is there a way to get SSIS to process these files? Could it be an SSIS setting on code-page etc?

Was it helpful?

Solution 2

The easiest solution for us was to stage the input into a SQL table, and then in a subsequent data-flow, query it back-out without line-feeds in the CSV output, e.g.

SELECT COLUMN1
       ,REPLACE(REPLACE([COLUMN2],CHAR(10),''),CHAR(13),'') AS [COLUMN2]
FROM TABLE

OTHER TIPS

For me opening the file in Excel, saving as an excel file (xlsx but I am sure the old xls format would work fine too), then using the Excel Source in SSIS enabled me to load a file into a SQL table with this kind of problem.

Obviously this would not work if you need to load this kind of file regularly or if there was many of these files. In that case the first answer would be better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top