[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Thu May 13 13:29:29 2004 -->
- <!--x-from-r13: syrgpu ng culqrnhk.bet (Tyrgpu) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: 1084406160.9097.93.camel@ibb-250 -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1084410323.9104.99.camel@ibb-250 -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1084411829.9103.102.camel@ibb-250 -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1084412639.9104.104.camel@ibb-250 -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Help Processing a Log File -->
- <li><em>date</em>: Thu May 13 13:29:29 2004</li>
- <li><em>from</em>: fletch at phydeaux.org (Fletch)</li>
- <li><em>in-reply-to</em>: <<a href="msg00523.html">[email protected]</a>> (Geoffrey's message of "Wed, 12 May 2004 22:10:27 -0400")</li>
- <li><em>references</em>: <1084406160.9097.93.camel@ibb-250> <<a href="msg00512.html">[email protected]</a>> <1084410323.9104.99.camel@ibb-250> <<a href="msg00515.html">[email protected]</a>> <1084411829.9103.102.camel@ibb-250> <<a href="msg00518.html">[email protected]</a>> <1084412639.9104.104.camel@ibb-250> <<a href="msg00523.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Help Processing a Log File</li>
[...]
Geoffrey> Fletch will likely post a one line solution later
Geoffrey> tonight or tomorrow. :) Glad it worked for you.
Well, I wasn't since yours more or less worked fine . . . :)
Since the username's repeated on the fileend line really all you've
got to watch for are the filestart and fileend lines. This is
presuming that lines for different jobs won't be interspersed.
freebie:~ 611> perl -lane '/^file(\S+)/||next;if($1eq"start"){($p)=$F[2]=~/(\d+)/}else{$p=($F[4]=~/(\d+)/)[0]-$p;$F[-2]=~/-n(\w+)/;print"$p $1"}' foo
9 omard
If lines for different jobs could be interspersed then you'd need to
keep a hash of [ user, start, end ] keyed by job id and then post
process it in an END block.
And just for fun . . .
freebie:~ 637> ruby -lane 'next if !/^file(start|end)/;if($1=="start")then$F[2]=~/(\d+)/;p=$1.to_i;else$F[4]=~/(\d+)/;p=$1.to_i-p;$F[-2]=~/-n(\w+)/;print"#{p} #{$1}";end' foo
9 omard
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org | Vincent, you should cease askin' \ o.O'
| scary questions." -- Jules =(___)=
| U
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00508" href="msg00508.html">[ale] Help Processing a Log File</a></strong>
<ul><li><em>From:</em> jonathan.glass at ibb.gatech.edu (Jonathan Glass)</li></ul></li>
<li><strong><a name="00512" href="msg00512.html">[ale] Help Processing a Log File</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
<li><strong><a name="00513" href="msg00513.html">[ale] Help Processing a Log File</a></strong>
<ul><li><em>From:</em> jonathan.glass at ibb.gatech.edu (Jonathan Glass)</li></ul></li>
<li><strong><a name="00515" href="msg00515.html">[ale] Help Processing a Log File</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
<li><strong><a name="00517" href="msg00517.html">[ale] Help Processing a Log File</a></strong>
<ul><li><em>From:</em> jonathan.glass at ibb.gatech.edu (Jonathan Glass)</li></ul></li>
<li><strong><a name="00518" href="msg00518.html">[ale] Help Processing a Log File</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
<li><strong><a name="00519" href="msg00519.html">[ale] Help Processing a Log File</a></strong>
<ul><li><em>From:</em> jonathan.glass at ibb.gatech.edu (Jonathan Glass)</li></ul></li>
<li><strong><a name="00523" href="msg00523.html">[ale] Help Processing a Log File</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00536.html">[ale] OpenLDAP Question</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00538.html">[ale] ALE Central meeting tonight</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00523.html">[ale] Help Processing a Log File</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00526.html">[ale] Help Processing a Log File</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00537"><strong>Date</strong></a></li>
<li><a href="threads.html#00537"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>