In replace(), print feedback to stderr, since fileinput hijacks stdout.
Attach a file by drag & drop or click to upload