The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 02-13-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,889
How do you know which lines you want and which you don't?

Let's say you want 3 lines, skip 3 lines, etc. Here's just one way (using GNU awk):


Code:
 awk '(int((FNR-1)/ 3))%2 == 0'  filename