生成和修改常用文本操作
https://support.i-search.com.cn/article/1608539443945
https://support.i-search.com.cn/article/1611883821981
word文件内容批量匹配并标注(修改字体样式)
from docx import Document
from docx.shared import RGBColor, Pt, Cm
import os
import glob
def pipei(file_path,keyword):
if not os.path.exists(file_path):
os.mkdir(file_path)
for file in glob.glob(file_path + '\*.docx'):
docx = Document(file)
for paragraph in docx.paragraphs:
print('段落:',paragraph.text)
for run in paragraph.runs:
print(run.text)
if keyword in run.text:
run.font.bold = True
run.font.color.rgb = RGBColor(255, 0, 0)
docx.save(file_path + '/' + os.path.basename(file))
正则清洗、匹配文本
https://support.i-search.com.cn/article/1610527332052
https://support.i-search.com.cn/article/1611563680017
表格文件常用的处理分享
https://support.i-search.com.cn/article/1594628148864
wps可能执行写入操作后为不关闭进程出现自动创建副本的情况,影响再次写入,这里推荐杀死wps进程
https://support.i-search.com.cn/article/1597628962216
https://support.i-search.com.cn/article/1598777203310
https://support.i-search.com.cn/article/1599983183676
https://support.i-search.com.cn/article/1604393874415
https://support.i-search.com.cn/article/1603762074275
https://support.i-search.com.cn/article/1599191315772
https://support.i-search.com.cn/article/1602556615136