Removing header or footer from file


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 06-04-2012
Removing header or footer from file

Hi Every one,
what is the coomand to remove header or footer from a file.
Please help me by providing command/syntax to remove header/footer from unix.
Thanks in advance for all your support.
# 2  
Old 06-04-2012
How many lines your header and footer contains (Or just the first and last line of a file) ??
And also what is your try to achieve the output ..
# 3  
Old 06-04-2012
Just need to remove header or footer based on file and requirement.
Then we will use that file in our application.
# 4  
Old 06-04-2012
Please do not leave people guessing. Show a representative sample of input, desired output, attempts at a solution and specify what OS and versions are being used.
# 5  
Old 06-04-2012
Here is the details .
Code:
/home/dsadm> uname -a
SunOS usplsah2s88002 5.10 Generic_147440-09 sun4v sparc SUNW,SPARC-Enterprise-T5220

And File content for your reference .

Code:
jah2s880as10608Part
jah2s880as11306Recommendation
ah2s880asSecondLevelServerJobNew
jah2s880as20406ModelOptionStatement
jah2s880as20415VehicleProdYear
Jah2s880as20303EWOSignoff
jah2s880as20705MatrlYrlyPrtVol
jah2s880as20814QualityPerson
jah2s880as20909PartDescription
jah2s880as21002Contract
jah2s880as21011PartYearBook
jah2s880as21012PartYearInfo
jah2s880as21208PartBuyer
jah2s880as20910PartDlsPls
jah2s880as20204GMOrgNew
jah2s880as21209ConversionRate
jah2s880as20608Person
jah2s880as30206ParentGMOrg
jah2s880as30216UltimateGMOrg
jah2s880as20609PersonTelephone

Actually my requirement based on file, in some files we need to remove header and for other some files need to remove footer from file.

Based on these details please let me know command to remove header or footer from file .

Last edited by Scrutinizer; 06-04-2012 at 06:52 AM.. Reason: code tags
# 6  
Old 06-04-2012
I'm assuming by header and footer you mean the first and last line of file.

To remove both "header" and "footer"
Code:
sed '1d; $d' inputfile

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
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
Need to Chop Header and Footer record from input file coolbudy Shell Programming and Scripting 4 08-09-2005 01:26 PM