2 odpowiedzi
+ 6
f = open("file", "r+")
delete = 2
count = 0
for line in f:
count++
if(count != delete):
f.write(line);
f.write("\n");
Untested but should work.
At least you get the idea.
+ 3
i guess read the file, save all lines as String elements of an array.
modify the array as you wish (add/remove/edit lines/ elements).
and overwrite your file with a new one containing every line of your array.