![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File filter | Dastard | Shell Programming and Scripting | 3 | 09-06-2007 10:50 AM |
| AIX printer filter | blacksm | AIX | 4 | 08-29-2007 01:58 AM |
| Filter passwd | Topsurfer | Shell Programming and Scripting | 11 | 01-05-2005 12:42 AM |
| sexist filter | Quintab | UNIX for Dummies Questions & Answers | 5 | 01-02-2005 04:52 PM |
| Mail Filter | collins | UNIX for Advanced & Expert Users | 4 | 11-16-2004 03:46 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Filter using awk
Hi,
I need to filter the output of a command and display omitting the first 6 lines and the last two lines..How can i do this using awk. command | awk ' NR > 7' will omitt the first 6 lines but dont know how to omit the last two lines.. can anyone help? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Check this
Strip 3 header lines and 4 trailer lines |
|
#3
|
|||
|
|||
|
Another tweak....
But not a good way to follow..if the file is very very big..as it reads the file twice.. awk 'NR>6 {print $0}' new | tac | awk 'NR>2 {print $0}' |
|
#4
|
|||
|
|||
|
Thanks ...I tried and it worked..
|
|||
| Google The UNIX and Linux Forums |