V
V
Vampre2018-03-09 15:19:51
Python
Vampre, 2018-03-09 15:19:51

How to remove read lines from txt or csv file?

There is a file that contains data separated by the \n character (or a csv file with one column). When reading line by line, you need to delete the read lines, for example:
file.readline()
.... # Actions with data
file.delete line / lines
The point is not to load the entire file into memory as a whole.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question