Is it possible to keep the column order using csv.DictReader?

后端 未结 5 851
忘掉有多难
忘掉有多难 2020-11-29 04:45

For example, my csv has columns as below:

ID, ID2, Date, Job No, Code

I need to write the columns

5条回答
  •  被撕碎了的回忆
    2020-11-29 05:13

    I know this question is old...but if you use DictReader, you can pass it an ordered list with the fieldnames to the fieldnames param

提交回复
热议问题