in reply to Re: Searching for two lines that begin with the same string
in thread Searching for two lines that begin with the same string
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Searching for two lines that begin with the same string
by shmem (Chancellor) on Dec 18, 2006 at 17:29 UTC | |
I'll answer both your posts in one: Please show a sample. Your sample data doesn't contain duplicates. This does:
If I run my snippet unaltered, I get
It outputs pairs: the previous and the current match. So if you have 3 lines starting with the same CIDR notated IP address, you'll get 4 lines back for that match. With 4 lines matching, you get 6 lines: 3 pairs. <update>
outputs just 4 lines for 4 matches. </update> --shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] [d/l] [select] |
by tgrossner (Novice) on Dec 18, 2006 at 19:36 UTC | |
Not sure why it does this for me... | [reply] [d/l] |
by shmem (Chancellor) on Dec 18, 2006 at 21:06 UTC | |
it just didnt work for me. Sorry for the rant mode of my previous post, but it just didn't work is just the type of answers that get me tempered. Never mind. I didn't "stomp down on yours" ;-) Regarding your word count - what's in 'routes.txt' ? Is this file consistent with your sample? Is the first char really a non-blank? Is the first sequence of non-blanks a CIDR notated IP address? --shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] |