python中有一个元素列表,格式如下:
['96\t00:00:00:19\t-16,894725\t15,201475\t26,976\t52,471\t10,081275\t42,177475\t32,0962']
['97\t00:00:00:19\t-17,007775\t15,198775\t26,979\t52,471\t9,971225\t42,177775\t32,20655']
['98\t00:00:00:19\t-17,010475\t15,204175\t26,977\t52,471\t9,966525\t42,181175\t32,21465']
['99\t00:00:00:19\t-16,9997\t15,1907\t26,981\t52,473\t9,9813\t42,1717\t32,1904']
['100\t00:00:00:20\t-17,0024\t15,17995\t26,979\t52,476\t9,9766\t42,15895\t32,18235']
更新:
我正在使用以下代码:
import os
import csv
dirlisting=os.listdir(os.getcwd())
for fname in dirlisting:
if fname.endswith(".csv"):
print "Processing: " + fname
fi=open(fname, 'rb')
data=fi.read()
fi.close()
fo=open(fname, 'wb')
fo.write(data.replace('\x00', ''))
fo.close()
with open(fname, 'rb') as csvfile:
sreader=csv.reader(csvfile, delimiter=' ')
rows=[r for r in sreader]
for row in range(6, len(rows)):
print rows[row]
我需要拆分此列表元素或将它们转换为其他形式,以便进一步处理它们。