2

I have a CSV file that may change over time in terms of the number of columns, but I need to read always the names of the same columns. How can I filter the columns without reading the entire document and build a new CSV with only the columns of interest? is it possible?

Thank you in advance,

user3043636
  • 559
  • 6
  • 23
  • You can find answers here - https://stackoverflow.com/questions/16503560/read-specific-columns-from-a-csv-file-with-csv-module – Srinivas Reddy Thatiparthy Oct 22 '20 at 10:33
  • 1
    How can I filter the columns and build a new CSV? Just read and parse the file and write back only the interesting columns. Is it possible without reading the entire document: no. Is it possible without loading the whole document in memory: of course, you can process CSV files line by line. – Serge Ballesta Oct 22 '20 at 12:45

0 Answers0