D
D
Davidaa_WoW2021-08-15 19:59:54
Python
Davidaa_WoW, 2021-08-15 19:59:54

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

1 answer(s)
D
dmshar, 2021-08-15
@Davidaa_WoW

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 question

Ask a Question

731 491 924 answers to any question