GeekInterview.com
Series: Subject:
Question: 16 of 71

Removing Header and Trailer Records

How to remove Header and Trailer records from a file using abinitio components?
Asked by: chaitugeek | Member Since Feb-2010 | Asked on: Sep 15th, 2010

View all questions by chaitugeek   View all answers by chaitugeek

Showing Answers 1 - 4 of 4 Answers
sham2sushil

Answered On : Oct 23rd, 2010

View all answers by sham2sushil

If there is no indicater for the Header and Trailer Records then You can use dedup sort component: In the select_expr use next_in_sequence() >1 : It will remove header record. Use the key as {} and keep last record. Then you can collect last record as tailer record for the out port and remaining record from the dup port.



--Shambhu

  
Login to rate this answer.

Do you know the concept of stripping header and trailers.
If the header is lying in the first colum then it can be removed by partition by expression componenet.
or
by using the reformat also we can bo by taking output indexes.

  
Login to rate this answer.
nagarjuna

Answered On : Jul 21st, 2011

You cam redefine format, Filter by expression & Run program components.

  
Login to rate this answer.
arnab ghosh

Answered On : Feb 22nd, 2012

Use Unix SED

#--------------------------------------------------------------#
# This line removes both the header and the trailer record
#--------------------------------------------------------------#
#sed 1d;$d $File1 > $File2

#--------------------------------------------------------------#
#--------------------------------------------------------------#
# This line removes the trailer record
#--------------------------------------------------------------#
sed $d $File1 > $File2

#--------------------------------------------------------------#

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.