Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

I am working on one task which need to transfer data from text file to destination after applying some business logic.

Below is my text file data


employee_id salary
10 1000
20 2000
30 3000
40 5000


I need to add one more column to it called as "pre_row_salary" which will be salary of employee in above index as per above table.
Look below table for more information.First row contain NULL in "pre_row_salary" column because there is no-one above it.Second row contain 1000 in "pre_row_salary" which is salary of employee 10. Third row contain 2000 in "pre_row_salary" which is salary of employee 20(Upper rank).


employee_id salary pre_row_salary
10 1000 Null
20 2000 1000
30 3000 2000
40 5000 3000

Let me know how can I process this text file data with this business logic to the destination.
Posted
Updated 9-May-12 0:07am
v4
Comments
Sandeep Mewara 3-May-12 5:00am    
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.

refer this website you will find out you requirements... http://www.sqlservercentral.com/Forums/Topic627016-298-3.aspx#bm632634[^]
 
Share this answer
 
You can use Script Component, add a new output column named pre_row_salary.
Then edit script to loop all record, set pre_row_salary in method ProcessInputRow.

Hope this will help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900