in reply to Re^2: Global substitution and report
in thread Global substitution and report

In which case, I'd slurp the file in, do the substitutions and write it back out to a temp file. Then I'd run diff on the original & temp files.