Reputation: 848
I have a CSV file in the following format
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"300","331"
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"700","701
In the above data, I want to add additional comma's after the numeric values in the 4th and the last row after the file is read using the Flat File Source
, in this case 6 additional comma's should be added in the 4th and the last row
so the correct data would be like this
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"300","331",,,,,,
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"Sometext","Sometext","Sometext","Sometext","Sometext","Sometext","Sometext",
"700","701,,,,,,
I have to add the comma's in the dataset only without modifying the existing file How can this be achieved in SSIS?
Upvotes: 1
Views: 2061
Reputation: 1973
One way to go would be to use a Script Component set as your source in your Data Flow Task. Find a detailed example in the following article on what it should include:
This would add missing columns, as well as ignore any extra ones depending on your first header row.
Upvotes: 0