Need to Chop Header and Footer record from input file


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 08-09-2005
Need to Chop Header and Footer record from input file

Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks.
# 2  
Old 08-09-2005
Quote:
Originally Posted by coolbudy
Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks.
You can use sed to print only those lines that are needed.

Or you can use grep similarily.

Vino
# 4  
Old 08-09-2005
If your header and footer are just one record length, you can use sed :
Code:
sed '1d;$d' input_file > output_file

This command delete firstrecord (1d) and last record ($d).


Jean-Pierre.
# 5  
Old 08-09-2005
Thanks a lot to all....for quick reply. ur suggestions are working well...i m using sed command given by aigles.Thanks once again buddy. Bye
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Split large xml into mutiple files and with header and footer in file karthik Shell Programming and Scripting 36 19 Hours Ago 01:33 AM
Eliminate Header and footer from EBCDIC file abhilashnair UNIX for Dummies Questions & Answers 4 12-18-2014 05:48 AM
File Row Line Count without Header Footer gagan8877 UNIX for Dummies Questions & Answers 7 05-02-2013 02:29 PM
Is there a way to append both at header and footer of a file jediwannabe Shell Programming and Scripting 3 02-28-2013 06:57 AM
Removing header or footer from file sridhardwh Shell Programming and Scripting 5 06-04-2012 06:43 AM
Add header and footer with record count in footer itsranjan Shell Programming and Scripting 1 03-25-2012 12:45 AM
Removing header and footer Tom Sawyer Shell Programming and Scripting 1 03-07-2012 11:26 AM
Header and Footer... suresh_target Shell Programming and Scripting 1 02-15-2012 04:44 AM
sort a report file having header and footer suryanarayana Shell Programming and Scripting 4 11-25-2011 10:48 PM
Ignore Header and Footer and Sort the data in fixed width file sasikari Shell Programming and Scripting 5 07-14-2011 12:42 PM
Help with the Header and Footer check Sunny_teotia UNIX for Dummies Questions & Answers 5 06-06-2011 12:14 AM
Inserting Header and footer digitalrg Shell Programming and Scripting 4 04-17-2009 06:17 AM
Split large file and add header and footer to each small files ashish4422 Shell Programming and Scripting 7 07-07-2008 03:13 PM
Split large file and add header and footer to each file ashish4422 Shell Programming and Scripting 1 04-15-2008 07:12 AM
Total of lines w/out header and footer incude for a file gzs553 Shell Programming and Scripting 1 11-16-2006 07:42 PM