in reply to doing a search and replace on a large file
That's a one-liner, provided your pattern is reasonably small. You don't need to open filehandles if you use perl's command line options and the shell to your advantage:
perl -lne 'print if /pattern here/' old_file.txt > new_file.txt
----
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: doing a search and replace on a large file
by eXile (Priest) on Apr 14, 2004 at 14:01 UTC |