首页 > 其他 > 详细

从doc文件提取asn部分

时间:2020-07-07 13:20:33      阅读:78      评论:0      收藏:0      [点我收藏+]
1.把doc文件复制到记事本里
2.python代码
asn_statu = 0
asn_txt_list = []
with open("D:/share/doc/38413.txt",encoding="gbk") as file:
last_line = ""
for line in file:
if line.find(‘ASN1START‘) != -1:
asn_txt_list.append("--" +last_line)
asn_statu = 1

if asn_statu:
# print(line)
asn_txt_list.append(line)

if line.find(‘ASN1STOP‘) != -1:
asn_statu = 0
if line.strip() != " ":
last_line = line


with open("D:/share/doc/38413-f60.asn", "w") as file:
for x in asn_txt_list:
file.write(x)


从doc文件提取asn部分

原文:https://www.cnblogs.com/Ziee/p/13260100.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!