Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to monitor a logfile with columns for certain data?

by thezip (Vicar)
on Nov 17, 2007 at 01:37 UTC ( #651360=note: print w/ replies, xml ) Need Help??


in reply to How to monitor a logfile with columns for certain data?

Hello freddie,

There is also a solution by using unpack:

#!/usr/local/bin/perl -w use strict; use Data::Dumper; my $spec = 'A24A9A15A8A8A8'; my $line = scalar <DATA>; my @arr = unpack($spec, $line); print Dumper(\@arr); __DATA__ N-20070143.003.TXT 05/23/07 02:36:59 PM 13 13 0 __OUTPUT__ $VAR1 = [ 'N-20070143.003.TXT', '05/23/07', '02:36:59 PM', '13', '13', '0' ];

Where do you want *them* to go today?


Comment on Re: How to monitor a logfile with columns for certain data?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-12-21 18:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls