You specified "no oneliners" and "no temp files". You have not specified what you are going to replace with what nor how big your file is. Under these conditions, I see no general solution (MS Word might use temp files, too, did you know?)
Re^5: opening file for editing
Replies are listed 'Best First'.