Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Copy previous cell's value to current cell in CSV

Author  Topic 

KhD
Starting Member

6 Posts

Posted - 2012-11-01 : 02:46:56
Hi,

I am working on an SSIS package where I need to read data from a CSV file and insert into SQL table. But before I do that, I need to do some pre-processing on the file.

The CSV file looks like this:

3004891W,Chander Shekhar Sud,In Force
3022180P,Carole Margaret Hill,In Force
-,-,-
3022181I,James Allen Hill,In Force
-,-,-
N601635J,Spencer John Privett,Auto Pup
-,-,-

I have to replace the "-" with previous (one row above) cell value.
Can someone please suggest how to do this?

I am flexible with the approach. It can be a script task or using a temporary table to hold the data, and then processing that data in a Data Flow Task.

Thanks!!

KhD
Starting Member

6 Posts

Posted - 2012-11-01 : 05:06:51
Hi,

I found the answer in another forum:

http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/d84482a8-8192-49d6-99a8-9f5e8929c2b7

Thanks!!
Go to Top of Page
   

- Advertisement -