Hi
If I want to remove the last row from my input file then how can I implement in DS server job?
I want to remove row at runtime.
Removing Last row from Input File
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 88
- Joined: Wed Apr 05, 2006 1:04 am
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
If you have MKS Toolkit or similar installed you can try the below said.
To remove just the last line from your file 'at runtime' use this command in your filter option of sequential file satge:
To remove just the last line from your file 'at runtime' use this command in your filter option of sequential file satge:
Code: Select all
sed -e '$d'
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
To have your job know the last row it needs to know how many rows are in the input file. Using a "wc -l" command (checkout CYG/Win or MKS Toolkit) you can pass the row count in and then use a simple constraint check.
Otherise, you'll have to be creative and use a SEQ-->AGG-->HASHed file portion of job design to read the sequential file, count() using the aggregator the number of rows and then write to a hashed file. Then a simple reference to the hashed file (pre-load to memory) and use of constraint in a transformer stage comparing the the @INROWNUM value to the referenced value and output when not the same will do the trick.
Otherise, you'll have to be creative and use a SEQ-->AGG-->HASHed file portion of job design to read the sequential file, count() using the aggregator the number of rows and then write to a hashed file. Then a simple reference to the hashed file (pre-load to memory) and use of constraint in a transformer stage comparing the the @INROWNUM value to the referenced value and output when not the same will do the trick.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle