Hello.
There is an answer to your problem, but it's a bit tricky.
You need to write another file with the same value as the original, line by line.
Then you will need to exclude the line you whant to remove, of course.
To keep you from doing this yourself, I wrote a small example.
Feel free to modify it and use it for your application.