Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

need help comparing values in different lines
Hello all,

I am a new (very new) user of awk and I am trying to write a if statement th
at will store a value in a variable, skip to the next line and store that sa
me value (but different line) and then compare the two.  If they are equal t
hen loop again, if they are not equal then print the line.  I will show you 
what the data looks like.  I am looking at the hour/minute field.  I want to
 be able to only print out the line when the first value on each minute chan
ges.  I want to skip the repeats of the minute.  Thanks for the help.

05 09 2006      0627  26 59.9890-111 25.715   396
05 09 2006      0627  26 59.9790-111 25.696   397
05 09 2006      0627  26 59.9690-111 25.677   398
05 09 2006      0627  26 59.9580-111 25.657   399
05 09 2006      0628  26 59.9480-111 25.638   400
05 09 2006      0628  26 59.9370-111 25.619   401
05 09 2006      0628  26 59.9260-111 25.599   402
05 09 2006      0628  26 59.9150-111 25.580   403
05 09 2006      0628  26 59.9050-111 25.561   404
05 09 2006      0629  26 59.8950-111 25.541   405
05 09 2006      0629  26 59.8860-111 25.521   406
05 09 2006      0629  26 59.8770-111 25.500   407
05 09 2006      0629  26 59.8670-111 25.478   408
05 09 2006      0630  26 59.8580-111 25.458   409
05 09 2006      0630  26 59.8480-111 25.438   410
05 09 2006      0630  26 59.8370-111 25.418   411
05 09 2006      0630  26 59.8270-111 25.399   412
05 09 2006      0630  26 59.8150-111 25.380   413
05 09 2006      0631  26 59.8040-111 25.362   414


The hour/minute is the fourth field over looks like (0631)

Report this thread to moderator Post Follow-up to this message
Old Post
jkluesner
09-30-06 12:41 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

AWK archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:15 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.