Function “replace” have a real bug. When I do replace in file with size more that 3-5 Mb, I lost part of text and see [CR][LF] symbols at various places of text. It is really so sad. Make me unsee it!
Which version are you running? I thought I fixed this bug for 18.104.22.168 and later.