if you're giving the user the ability to edit the section, then i assume you don't want to merge the results of the edits into the same section of the other file, but you merely want to replace the whole section. do this simply by having 1 or 2 other files which have all the text excluding that section, and join it with the edited section. i.e. new file will contain: constant text 1, edited new section, and then contant text 2