我有一個大的文本文件,我想從中讀取特定的行並將它們寫入另一個小文件中。舉例來說,在我的文字Python讀取特定的備用行
line1
line2
line3
line4
line5
line6
line7
line8
line9
line10
...
現在我想先讀一號線,4號線,line7,line10 ...,然後2號線,LINE5,line8,...,最後3號線,LINE6,line9 ,. ...所以,我也想把所有三組線分別寫入另外三個小文件中。任何人可以建議如何使用readlines()
或其他類似的Python方法?