in reply to Re: Slow find/replace hex in Perl win32
in thread Slow find/replace hex in Perl win32
Just to clarify, there are no line-endings in this file (at least not in ASCII).
I do think I found the problem, though. I didn't realize that perl was trying to find the end of line. Searching for that, I found "slurp mode", -0777 (undefined record separator). And using a few other recommendations, I also reduced the s///sgx options to just s///g, since my example didn't seem to need s and x. It seems to allow the file to be processed in a matter of seconds, and compares properly to other files processed "manually" with hex editors.
perl -0777 -pe "s/\x00\x42\x00\x11/\x00\x42\x00\xf0/g" input > outputI'm waiting on the availability of another file to test another hex string against, but it won't be available until Oct 1. I think the issue is resolved, but I'd like to wait until then to be sure, unless anyone else has any recommendations or considerations I should be aware of.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Slow find/replace hex in Perl win32
by rickyboone (Novice) on Oct 07, 2010 at 14:41 UTC | |
by BrowserUk (Patriarch) on Oct 07, 2010 at 15:12 UTC |