in reply to how to remove a specific character from a file efficiently..

Why not do that in a separate process instead of adding it in your script.
perl -pi -e 's/\\n\"\)]]]$/")]]]/g' <filename>
Either via a batch script or a shell script or on command line itself or a cron job.

Replies are listed 'Best First'.
Re^2: how to remove a specific character from a file efficiently..
by ikegami (Patriarch) on Jul 02, 2014 at 22:33 UTC
    That will not make it any faster. It's very likely to make it slower.
      Obviously, if you call an external command it will make it more slower.
      My suggestion was to do it separately in a pre-process and thereafter initiate the script, so that it takes the same time.