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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AWK, Log file dates, <= && >=

Status
Not open for further replies.

stevenawk

Programmer
Nov 12, 2008
9
DE
Hi,

test2 contains:
[2008-11-18 13:41:44,478]
[2008-11-14 13:42:44,478]
[2008-11-15 13:43:44,478]
[2008-11-16 13:44:44,478]
[2008-11-17 13:45:44,478]
[2008-11-13 13:46:44,478]

I am trying to pull out lines between 2 dates. So far i have this line:

nawk '$0>="["from && $0<="["to' from="2008-11-16" to="2008-11-18" test2

It is only returning:
[2008-11-16 13:44:44,478]
[2008-11-17 13:45:44,478]

like it's not equaling the 18th.

So frustrating. Any help greatly appreciated.

S.
 
I'd try the following:
nawk '$0>="["from && $0<="["to' from="2008-11-16" to="2008-11-18 [!]9[/!]" test2

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV,

adding that high 9 forces it to include everything below it.

ta !

S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top