Get Header and Trailer record using a single sed command
Posted: Thu Aug 06, 2015 6:38 pm
Hi ,
I have used sed command successfully in the Filter property of sequential file stage in the past
to get
--> all records without header and trailer
--> just the header record
--> just the trailer record
But I want to get just the header and trailer using a same sed command
So far, I have tried
without any luck
Also, tried sed with -r flag as in sed -r and again no desired output.
Any pointers/help to achieve the same would be much appreciated
Thanks,
Raja
I have used sed command successfully in the Filter property of sequential file stage in the past
to get
Code: Select all
sed -e '1d' -e '$d'
Code: Select all
sed '1!d'
Code: Select all
sed '$!d'
But I want to get just the header and trailer using a same sed command
So far, I have tried
Code: Select all
1.sed '1!d;$!d'
2.sed -e '1!d' -e '$!d'
without any luck
![Embarassed :oops:](./images/smilies/icon_redface.gif)
Also, tried sed with -r flag as in sed -r and again no desired output.
Any pointers/help to achieve the same would be much appreciated
Thanks,
Raja