Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Reading two lines down???, Programming Trouble
Blackhat
post Dec 29 2008, 10:10 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 29-December 08
Member No.: 13,825



Hello,

I'm trying to write a gawk file that will do the following:


Here's some sample input:


3000 1 40 2 2 2 0
0.00000E+00 0.00000E+00 0.50500E+00 0.89521E+00 -0.44468E+00 -0.29444E-01 0.30000E-01 0.10000E+01 0.00000E+00
2012 2 1.2 91 2 1 1 0
0.15202E+00 -0.75511E-01 0.50000E+00 0.89521E+00 -0.44468E+00 -0.29444E-01 0.30000E-01 0.10000E+01 0.56643E-03
4000 3 1.1 1 2 2 2 0
0.22390E+00 -0.11122E+00 0.49764E+00 0.89521E+00 -0.44468E+00 -0.29444E-01 0.30000E-01 0.10000E+01 0.83427E-03
4000 3 3000 -1 2 2 2 1
0.42874E+01 -0.21297E+01 0.36398E+00 -0.86774E+00 -0.49603E+00 -0.31255E-01 0.27344E-01 0.10000E+01 0.15976E-01
2012 3 3000 -1 2 2 2 2
0.53149E+00 -0.42768E+01 0.22869E+00 -0.30822E+00 -0.10727E+00 -0.94525E+00 0.26250E-01 0.10000E+01 0.30414E-01
2012 3 3000 -3 2 2 2 3
0.26409E+00 -0.43698E+01 -0.59136E+00 -0.30822E+00 -0.10727E+00 -0.94525E+00 0.26250E-01 0.10000E+01 0.40525E+00

I'd like to do the following:

if ($1 = "2012" && (2 lines down, not sure how to write this) != 2012)
print "Stuff"

so that in this example "Stuff" Would be printed only once and not when 2012 is followed immediately by 2012 again two lines down.


Any help on this would be greatly appreciated!

Thanks,
Blackhat
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th November 2017 - 06:47 AM