Any chance you could pattern match as I proposed, the match being the pattern at the end of the file, then replace the pattern with the same but with your changes added onto the end?
Any chance you could pattern match as I proposed, the match being the pattern at the end of the file, then replace the pattern with the same but with your changes added onto the end?