couldn't you just load all the text into a text field, modify it and then overwrite the old file with the new info?
Or
I do a similar thing as you are suggesting by using several text areas. Instead of "editing" the data, I just ask for the info as if it was the first time each time and then write the file.