Hi Monks
i am littlebit knowledge in perl,at present i am working on task to parse log file to get starttime,endtime and
version,and also total time taken as stime-endtime,
and it also counts the no of warning messages.
After getting this information ,the script should write these information in a text file.
.
Below is the code i am trying to parse the log file and also after running i am getting the lines which i am
attaching here below the title OUTPUT.
#!/usr/bin/perl -w
open(F,"build.log") or die "can't open $!\n";
while($line=<F>)
{
chomp $line;
@a=$line;
foreach(@a)
{
#print "$_\n";
if($_=~/Building IVR Designer version /)
{
#print "$_\n";
push @b,$_;
for(@b)
{
@c=split(" ",$_);
print "@c\n";
#for(@c)
# {
# @m=split(" ",$_);
# print "@m\n"; }
}
}
}
}
OUTPUT
Info: Wed Mar 28 18:53:03 2007:Building IVR Designer version 06.00.08....
Info: Wed Mar 28 18:53:03 2007:Building IVR Designer version 06.00.08....
Info: Wed Mar 28 18:56:31 2007:Building IVR Designer version 6.0 Completed !!!.
monks share yr ideas on this task and help me out towards the complition of this task
keep pouring your ideas....
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.