# 引入openpyxl
import openpyxl as xl
import re
#获取txt文件内容
def get_content_from_txt(txt_file):
dataList = []
file_object = open(txt_file,encoding='gb18030',errors='ignore')
try:
for line in file_object:
dataList.append(line)
finally:
file_object.close()
# print(dataList)
return dataList
openpyxl读取txt写入excel
最新推荐文章于 2025-02-10 14:47:22 发布