【发布时间】:2017-11-27 06:10:04
【问题描述】:
我阅读了 csv 文件。然后我通过了空行。 当我发现一行不为空时,不要读取它并从下一行读取。 我怎样才能做到这一点? 这是我的代码。
f = open(self.row, 'r') #file open
for line in f.xrealines():
if not line.strip() : #check if a line is empty or not
continue
else:
#I want to skip one line and then adjust next line.
row = line.strip('Wn').split(".')
【问题讨论】:
标签: python-2.7 csv