[SunHELP] script challenge
Michael Marziani
sunhelp at sunhelp.org
Wed Feb 21 17:02:25 CST 2001
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C09C5A.5AD349C0
Content-Type: text/plain;
charset="iso-8859-1"
I wouldn't insult your intelligence by writing the script for you, because
this would be extremely easy to do in Perl (my scripting language of
choice). Simply read the file in, grab the first line and snag and parse
the date, then look for the line with /Average/ in it, grab the average
ping, put them together how you want and append the output to your other
file. The first 2 chapters of most any perl book (or web tutorial) will
give you the info to get this done in short order.
-Mike
-----Original Message-----
From: Naser Ali [mailto:Ali.Naser at irs.gov]
Sent: Wednesday, February 21, 2001 3:39 PM
To: sunhelp at sunhelp.org
Subject: [SunHELP] script challenge
Gurus,
I have an input file which has the following data in it,
############ 20010216_200000 ###########
220
190
180
190
210
180
190
190
190
180
The Average time for this ping is: 192
########################################
############ 20010216_203000 ###########
The listner is down at this time
########################################
What I would like to do is associate the "Average" time with the collection
time and put it in a seperate file ignoring the rest, in the following
format,
2001::02::16::192
I hope I am clear on this question.
Any help or suggestion will be greatly appreciated.
TIA
------_=_NextPart_001_01C09C5A.5AD349C0
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>script challenge</TITLE>
<META content="MSHTML 5.50.4611.1300" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=257575522-21022001><FONT face=Arial color=#0000ff size=2>I
wouldn't insult your intelligence by writing the script for you, because this
would be extremely easy to do in Perl (my scripting language of choice).
Simply read the file in, grab the first line and snag and parse the date,
then look for the line with /Average/ in it, grab the average ping, put
them together how you want and append the output
to your other file. The first 2 chapters of most any perl book
(or web tutorial) will give you the info to get this done in short
order.</FONT></SPAN></DIV>
<DIV><SPAN class=257575522-21022001><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=257575522-21022001><FONT face=Arial color=#0000ff
size=2>-Mike</FONT></SPAN></DIV>
<DIV><SPAN class=257575522-21022001></SPAN><FONT face=Tahoma><FONT size=2><SPAN
class=257575522-21022001><FONT face=Arial
color=#0000ff> </FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=257575522-21022001></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=257575522-21022001> </SPAN>-----Original Message-----<BR><B>From:</B>
Naser Ali [mailto:Ali.Naser at irs.gov]<BR><B>Sent:</B> Wednesday, February 21,
2001 3:39 PM<BR><B>To:</B> sunhelp at sunhelp.org<BR><B>Subject:</B> [SunHELP]
script challenge<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE>
<P><FONT face="Comic Sans MS" color=#000000 size=2>Gurus,</FONT> </P>
<P><FONT face="Comic Sans MS" color=#000000 size=2>I have an input file which
has the following data in it,</FONT> </P>
<P><FONT face="Comic Sans MS" color=#000000 size=2>############
20010216_200000 ###########</FONT> <BR><FONT face="Comic Sans MS"
color=#000000 size=2>220</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>190</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>180</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>190</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>210</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>180</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>190</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>190</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>190</FONT> <BR><FONT face="Comic Sans MS" color=#000000
size=2>180</FONT> <BR><FONT face="Comic Sans MS" color=#000000 size=2>The
Average time for this ping is: 192</FONT> <BR><FONT face="Comic Sans MS"
color=#000000 size=2>########################################</FONT> </P><BR>
<P><FONT face="Comic Sans MS" color=#000000 size=2>############
20010216_203000 ###########</FONT> <BR><FONT face="Comic Sans MS"
color=#000000 size=2> The listner is down at this time</FONT> <BR><FONT
face="Comic Sans MS" color=#000000
size=2>########################################</FONT> </P>
<P><FONT face="Comic Sans MS" color=#000000 size=2>What I would like to do is
associate the "Average" time with the collection time and put it in a seperate
file ignoring the rest, in the following format,</FONT></P>
<P><FONT face="Comic Sans MS" color=#000000 size=2>2001::02::16::192</FONT>
</P>
<P><FONT face="Comic Sans MS" color=#000000 size=2>I hope I am clear on this
question.</FONT> <BR><FONT face="Comic Sans MS" color=#000000 size=2>Any help
or suggestion will be greatly appreciated.</FONT> <BR><FONT
face="Comic Sans MS" color=#000000 size=2>TIA</FONT>
</P><BR><BR></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C09C5A.5AD349C0--
More information about the SunHELP
mailing list