IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New No code - context grep
grep -B 2 "stuff_you_are_looking_for" file.name

\n-B NUM, --before-context=NUM\nPrint  NUM  lines  of  leading  context  before  matching lines.\nPlaces  a  line  containing  --  between  contiguous  groups  of\nmatches.\n


Or is the number of lines variable?

In that case:

\n#!/usr/bin/perl -w\nuse strict;\n\nmy $look_for = shift;\n\nmy $last_time_stamp = '';\nmy @current_xml = ();\n\nwhile (<>){\n\n#\n# I need a REAL exmaple of the time stamp line!!\n# Pretend it is MMDDYY : Stuff\n#\nif (/^\\d{6}\\s:/){\n$last_time_stamp = $_;\n@current_xml = ();\nnext;\n}\npush (@current_xml, $_);\n\nif (/$look_for/){\nprint "Found it: [$look_for]\\n";\nprint "$last_time_stamp\\n";\nprint join("\\n",@current_xml),"\\n";\n}\n\n}\n



LRPD:
Somewhere out there, a Big Cheetah is still running WordStar and extremely anal benchmarks...

No it's not:
[link|http://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&safe=off&c2coff=1&q=%22big+cheetah%22+pournelle&btnG=Google+Search|http://www.google.co...tnG=Google+Search]

Retired in 1996

I've realized the LRPDs are the ultimite"in" jokes.
Expand Edited by broomberg March 5, 2004, 07:51:01 PM EST
New gah, man grep would have got it :(
forget there is a crapload of flags, my bad for not looking it up
thanx a bunch,
bill
when I was young I envisioned myself as the embodiment of Trinity, Now I realize I have turned into the Bambino
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
     how to do this - (boxley) - (4)
         Re: how to do this - (jake123)
         Re: how to do this - (pwhysall)
         No code - context grep - (broomberg) - (1)
             gah, man grep would have got it :( - (boxley)

Mine almost shook the furnace apart.
88 ms