Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 335 Bytes

数据处理相关(python).md

File metadata and controls

16 lines (14 loc) · 335 Bytes

Python读取txt文件中特定位置的字符:

import sys
reload(sys)
sys.setdefaultencoding('utf8')
fp = open("resources.txt", "r")
sample = fp.readlines()

file=open("test.txt", "w")

for line in sample:
    sample_ = line.split('固定字符')
    print(sample_[n])
    file.write(sample_[n])
    file.write('\n')