Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: In-place file filtering

by skyknight (Hermit)
on Jul 24, 2003 at 19:33 UTC ( #277666=note: print w/replies, xml ) Need Help??


in reply to In-place file filtering

How about something along the lines of...

perl -i.bak -n -a -e 'print if $F[1] =~ /\d{5}/ and $F[1] > 713 and $F +[1] < 99930' *.dat

You don't want the -p switch because you don't always want to print. Use the -n switch instead for the same implicit while loop, but without the implicit print.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://277666]
help
Chatterbox?
[Discipulus]: yes but in a little house with fireplace; 2 friends and lot of beverages..
[Corion]: Discipulus: Aah, so it's not really walking through quick-changing weather
[Discipulus]: no fear: moonday i'll back (unless a big quake ... ;=)
[Corion]: Discipulus: Being out in nature is great, at least as long as you have a dry place to sleep and a warm fire ;)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-02-24 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (353 votes). Check out past polls.