Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: doing a search and replace on a large file

by blue_cowdawg (Prior)
on Apr 14, 2004 at 13:35 UTC ( #345050=note: print w/ replies, xml ) Need Help??


in reply to doing a search and replace on a large file

      Any ideas about how I might do this?

Here's one way...

#!/usr/bin/perl -w use Tie::File; use strict; my @ry=(); tie @ry,"Tie::File","mybigfile" or die "mybigfile:$!"; @ry = grep /mypattern/,@ry; untie @ry;

Please note: that was off the top of my head and untested.


Comment on Re: doing a search and replace on a large file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2014-07-11 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (235 votes), past polls