So I have a very large file with a few thousand line that look something like this:
this a line
some line are long like this one
some are very longgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg like this
some are even longer than that
some are small like the line after this one
a
and this continue on for a few more thousand line
So for example I want to edit line 4724 just a random line from it current value: this is a line that im using as an example
to I want to edit the line into this
. How can I do that in python. If you need more info just ask me in the comment.
Edit: the file is something around 300KB and yes I have try readlines()
and it only return 1/3 of the whole file. So that why i say memory is a problem