Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


Removing header or footer from file


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
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  
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  
Just need to remove header or footer based on file and requirement.
Then we will use that file in our application.
# 4  
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  
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  
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
Eliminate Header and footer from EBCDIC file
abhilashnair
Is there any command to eliminate Header and footer from EBCDIC file... UNIX for Dummies Questions & Answers
4
UNIX for Dummies Questions & Answers
Is there a way to append both at header and footer of a file
jediwannabe
currently I've a file Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('024', '024', 2, sysdate); Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('032', '032', 2, sysdate); ........ is it...... Shell Programming and Scripting
3
Shell Programming and Scripting
Add header and footer with record count in footer
itsranjan
This is my file(Target.txt) name|age|locaction abc|23|del xyz|24|mum jkl|25|kol The file should be like this 1|03252012 1|name|age|location 2|abc|23|del 2|xyz|24|mum 2|jkl|25|kol 2|kkk|26|hyd 3|4 Column 1 is row indicator for row 1 and 2, column indicator is 1,for data rows...... Shell Programming and Scripting
1
Shell Programming and Scripting
Removing header and footer
Tom Sawyer
I have two files which are getting sent to a UNIX server in order to be bcp'd into a database. The bcp is failing because there's a header and footer row on the file which give the date of the file and the number of rows in it. That's because the file is also being used for another process, so we...... Shell Programming and Scripting
1
Shell Programming and Scripting
sort a report file having header and footer
suryanarayana
I am having report file with header and footer . The details in between header and footer are separated by a pipe charater. I want to sort the file by considering multiple columns in between header and footer. pls help... Shell Programming and Scripting
4
Shell Programming and Scripting

Featured Tech Videos