【发布时间】:2020-08-25 19:32:03
【问题描述】:
我有一个包含一些数据的 csv 文件 下面的 csv 文件示例
these file is crypted with "asdfg"
Name,Status,Time
abc,failed,7:30
these file is crypted with "asdfgghklm"
Name,Status,Time
def,running,12:30
输出 -
Name,Status,Time
abc,failed,7:30
def,running,12:30
我想使用 python 跳过整个 csv 文件中存在的某些行有什么办法吗? 感谢您的帮助
【问题讨论】:
-
所以你想遍历 csv 中的备用行?
-
是的!如果这些有效。
-
link 这些给出了列表中的每一行,所以我如何跳过我的 csv 中不想要的列表?
-
如果每隔一行,您可以在循环计数器上使用模数运算。你看过我发布的第一个链接吗?
标签: python-3.x excel csv web-scraping