Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print next line

Status
Not open for further replies.

rhnaeco

Technical User
Aug 11, 2005
45
Hi,
I have a data file like this ($1 being the line number)
32....
33,8,8,8,8,8,8,8,8,8,8,8,8,8,8,245,230,120....
34,8,8,8,8,8,8,8,8,8,8,8,8,8,8,210,90,45....
35,200,200,200,200,200,200,200,200,105,214....
36....

what i want is for awk to:
if ($2 == "200") print next line only.

i have several of these '200' lines and want a file with just the lines that have suceeded each '200' line

i tried:
if ($2=="200") getline
print
but as you probably know, this printed every line after rather than just the one

hope you can help

rhnaceo
 
if ($2=="200") [!]{[/!]
getline
print
[!]}[/!]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i guess it was just the formatting that needed seeing to.

cheers, that solved it

rhnaeco
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top