I have a text file in which I need to add some lines after a particular line is encountered.
I have tried making an stream object and then reading from the file until I get the search text and then writing to the same stream by setting its cursor position, but it does not work.
Is there any way to do this?
here’s how you can append some text in the middle of the file:
this will insert
myTextafter the line that contains<Sim Properties>.