我有一个文本文件结构为:
date downland user date data1 date2 201102 foo bar 200 50 201101 foo bar 300 35
因此不需要文件的前六行。档名:dnw.txt
f = open('dwn.txt', 'rb')
如何将这个文件从EOF的第7行开始“拆分”?
with open('dwn.txt') as f: for i in xrange(6): f, next() for line in f: process(line)
更新 :next(f)用于python3.x。
next(f)