What I would like is just a Perl script like Replace.pl with this function in it because it also has to read the replacement text from another file.
In other words what would a function in that script look like?
Also, what is the offset variable for, can you explain just a little? :)
Thanks,
P.
Main Topics
Browse All Topics





by: holliPosted on 2003-07-25 at 11:28:19ID: 9006899
you can put the following into a batch-file:
\1replacem ent/;print ;" %1
@echo off
perl -0ni.old -e "s/^(.{offset})searchtext/
rem remove this to keep the original file
del %1.old
goto end
:error
echo Usage foo.bat [filename]
:end
change offset, searchtext and replacement to your needs.