Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: how to extract fields from the output and how to convert it to html format

by lima1 (Curate)
on Apr 03, 2007 at 08:12 UTC ( [id://608001]=note: print w/replies, xml ) Need Help??


in reply to how to extract fields from the output and how to convert it to html format

Read perlre.
#!/usr/bin/perl use strict; use warnings; #open my $F, '>', $file or die "can't open $!\n"; while (my $line = <DATA>) { chomp $line; my ( $date, $version ) = $line =~ m{ \A Info: \s (.*?):Building.*? version \s ([\d\.]+) }xms; + print "$date $version \n"; } __DATA__ 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 Compl +eted !!
outputs:
Wed Mar 28 18:53:03 2007 06.00.08.... Wed Mar 28 18:53:03 2007 06.00.08.... Wed Mar 28 18:56:31 2007 6.0
The version is not correct, but it is because you truncated the output? If not: when you understand the regex, it should be easy to fix.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://608001]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-20 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found