Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: scalable chomping

by picabotwo (Initiate)
on Oct 29, 2008 at 20:58 UTC ( [id://720335]=note: print w/replies, xml ) Need Help??


in reply to scalable chomping

You are going to have to open the file and process each item line by line.
$input = "oldlog"; my $output = "newlog"; open (INPUT,"<$input") || die "$!\n"; open (OUTPUT,">$output") || die "$!\n"; foreach $line (<INPUT>) { chomp($line); # remove newlines or whatever regex # do line-by-line processing. print OUTPUT $line; } close INPUT; close OUTPUT;
This will open your log file, do something to it line by line and dump the results in another logfile. The regex stuff is the hard part.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 03:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found