作者sariel0322 (sariel)
看板Python
標題[問題] 讀容量大的文字檔
時間Tue May 20 22:31:33 2014
想請問一下,我有一個27GB的文字檔
用PYTHON跑都會讀不出來或是跑到當掉
想請問該如何解決
程式碼:
import csv
f = open('123.full','r')
o = open('output.txt','w')
for i in csv.reader(f):
o.write(str(i)+'\n')
f.close()
o.close()
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 120.126.36.171
※ 文章網址: http://webptt.com/m.aspx?n=bbs/Python/M.1400596296.A.F8F.html
1F:推 disap:for i in open('123.full','r'): o.write(str(i)+'\n') 05/20 23:00