Question : SSIS Importing CSV file

I have set up a Flat File Source in SSIS to load in a CSV file. The trouble that I am having is that some rows have 10 columns, some have 15. When I set up the column structure, the first row had 10 columns, so I added the missing columns to the data structure, but when I do that, it does not appear to be picking up the CR/LF characters, so in the column that I create, it looks like its pulling in the CR/LF control characters followed by the first value of the new line and so on.

I've tried all the variations of the row delimiter, but nothing seems to work as the line feed and properly load the new line of data.

Could it be that the csv source file has an unknown CR/LF character or am I not setting up the parameters of the file connection properly?

Answer : SSIS Importing CSV file

it might be possible that when you added the extra columns the CR/LF on that line might have been messed up..if you added all the extra columns needed ..i would say, open the CSV file in Excel format and then add an extra blank column to the end (using insert column to right in excel).. Doing that, will add an extra column to the end with correct CR/LF.. In SSIS, Source just select the columns that you need..

If this is a recurring process where the file has In Variable columns.i would suggest you to take a dynamic approach by using script task where you can split the data as suggested in link below , so that you don't have to do any changes to the file manually

http://agilebi.com/cs/blogs/jwelch/archive/2007/05/08/handling-flat-files-with-varying-numbers-of-columns.aspx
Random Solutions  
 
programming4us programming4us