Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Looking for a string from a huge log file

by pvaldes (Chaplain)
on Sep 13, 2012 at 21:08 UTC ( #993579=note: print w/replies, xml ) Need Help??

in reply to Looking for a string from a huge log file

Not my intention to be rude, but delete this script, think a little in what do you want to do and try again. Seriously, is very poor.

For example: You claim to have a big file, Well, you are chomping each same line of this huge file up to three times. So your script is very bussy... doing nothing. If you need to delete a special input separator redefine $/

Don't apply four lines of regex if you want to delete a line containing "my pattern". Use "grep-not" (grep !/my pattern/, FH) instead.

keeps on printing the same string for all the other ID's

because $_ is not changing at all in the last lines. The loop has finished when you print to outfile so you only have the last matched line of your log in $_.

can you explain a little what do you need to do?


Try to keep it simple and readable, filehandles don't need to be complicated:

  • Comment on Re: Looking for a string from a huge log file

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993579]
and cookies bake in the oven...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2018-01-18 17:02 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (213 votes). Check out past polls.