Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Muy Large Fileby TilRMan (Friar) |
on Mar 14, 2005 at 10:33 UTC ( [id://439218]=note: print w/replies, xml ) | Need Help?? |
Update: As thor points out, my solution here is quite wrong. Sorry. On unixy platforms, Perl has exactly what you need already built in. (Windows users may need a binmode somewhere.)
If your records do not have newlines at the end, then you will need to set the record length. Add the following line to the script, replacing 4096 with the record length:
The magic is in the -pi which turns on in-place editing in a loop (more at perlrun). Then the tr/// operator runs on every record, replacing the offending characters with spaces (more at perlop). Use tr/// instead of s///; it's probably faster and safer. Note: Code is mostly untested. Use with caution.
In Section
Seekers of Perl Wisdom
|
|