Just to be clear, a CSV file is also a "flat file". You are converting from a Fixed Width flat file to a Comma Delimited Flat File.
That being said, you would create a Data Flow Task. In it you would use a Flat File Source and a Flat File Destination. In the source, under Format, select Fixed Width. You then can set the columns using the GUI interface in the Columns section. For
the destination, select a format of Delimited, and in the Columns section you can select Column delimiter as a comma.
Matt
If this helps, please mark as Answer.
Marked as answer by Chen Yu - MSFT on Jan 03, 2013 01:36 AM
I have a fixed width flat file with 2 records. I am converting into csv file. If there is only one record it is working fine. Where as in multiple records it is not taking the fixed widths.
Ex: Subject 100200
Subject 300400
I need the CSV file in this format
Subject ,100,200
Subject ,300,400
But i am getting my Output as Subject , 100,200
Subject ,3,004,00 How to solve this issue please help to me..
sailakshmi.e
Member
5 Points
33 Posts
Converting FlatFile to CSV File in SSIS
Dec 27, 2012 06:53 AM|LINK
Hi,
I have a Flat File With the following data..
Column1 is Id of 5 characters Column2 is Name of 10 Characters Column 3 is Salary of 5 characters.. Column 4 is Dept of 5 charcters
If the characters are less than 5 we are providing Spaces..
Ex: 123 Ram 10000MARKT
Now i need to Convert my Flat file to Comma saperated File.. in SSIS..
Please help me..
AZMatt
Star
11052 Points
1963 Posts
Re: Converting FlatFile to CSV File in SSIS
Dec 27, 2012 11:01 PM|LINK
Just to be clear, a CSV file is also a "flat file". You are converting from a Fixed Width flat file to a Comma Delimited Flat File.
That being said, you would create a Data Flow Task. In it you would use a Flat File Source and a Flat File Destination. In the source, under Format, select Fixed Width. You then can set the columns using the GUI interface in the Columns section. For the destination, select a format of Delimited, and in the Columns section you can select Column delimiter as a comma.
Matt
sailakshmi.e
Member
5 Points
33 Posts
Re: Converting FlatFile to CSV File in SSIS
Jan 09, 2013 04:42 AM|LINK
Thanks. it worked for me..
sailakshmi.e
Member
5 Points
33 Posts
Re: Converting FlatFile to CSV File in SSIS
Jan 10, 2013 05:30 AM|LINK
Hi,
I have a fixed width flat file with 2 records. I am converting into csv file. If there is only one record it is working fine. Where as in multiple records it is not taking the fixed widths.
Ex: Subject 100200
Subject 300400
I need the CSV file in this format
Subject ,100,200
Subject ,300,400
But i am getting my Output as Subject , 100,200
Subject ,3,004,00 How to solve this issue please help to me..
sailakshmi.e
Member
5 Points
33 Posts
Re: Converting FlatFile to CSV File in SSIS
Jan 10, 2013 06:19 AM|LINK
HI i got the solution.
Choose the file format as "Ragged Right" instead of "Fixed Width".