in reply to Extract lines between two values from file
Hi choroba,
Thanks for you reply.
You're absolutely right, the value of $end_point does not exist. I read up on flip-flop operator (which I of course should've done before posted), and a person describes it like this: "The first operand (the left-hand expression) is evaluated to see if it is true or false. If it is false then the operator returns false and nothing happens. If it is true, however, the operator returns true and continues to return true on subsequent calls until the second operand (the right-hand expression) returns true."
So, with other words I can change $end_point to "09:05:00". Then I'll still get everything up towards the latest entry which contains "09:04:49", all the way up to "...,999" if that exists. And as the right expressions becomes false when the next line contains "09:05:00,xxx", I wont get any values from within that minute (which is what I want)
It was a simple and easy solution, but I don't think I could've gotten out of the deep and frustrating hole I was in if it wasn't for your "thank you captain Obvious"-response, so thanks a lot. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extract lines between two values from file
by aaron_baugher (Curate) on Nov 08, 2011 at 14:03 UTC | |
by plexy (Initiate) on Nov 08, 2011 at 14:42 UTC |