Answer the question
In order to leave comments, you need to log in
How to start recording from a specific line in python csv?
I have a csv file, it already has entries for a couple of thousand lines. Now I need to continue writing to the file through the csv writer in python, only from a certain line. Is there any possibility to start recording from a specific line specified manually?
Answer the question
In order to leave comments, you need to log in
You can append to a file simply by specifying the value "a" in the methods for working with the file.
Or are you going to OVERWRITE the rest of the file after some line?
Well, if the length of the lines being written is known, then you can move to the required number of bytes (the seek method) and write starting from this place, overwriting everything that was written there earlier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question