目录 Python之文件处理-批量修改md文档内容 Python之文件处理-批量修改md文档内容 #!/usr/bin/env python # -*- coding:utf-8 -*- import os import re import time def modify_md_content(top): for root, dirs, files in os.walk(top, topdown=False): # 循环文件 for file_name in files: file_name_s
Sub 按模板修改Excel文件() Dim MoBanWorkBook As Workbook Set MoBanWorkBook = Application.ActiveWorkbook Dim MoBanSheet As Worksheet Set MoBanSheet = MoBanWorkBook.Worksheets(1) With Application.FileDialog(msoFileDialogOpen) .AllowMultiSelect = True .Filters.
在工作当中,我们往往需要修改某个文件夹下面所有文件的内容,例如把里面的日期统一替换成新的日期,或者把某一串字符替换成另外一串字符,这时我们就可以使用sed命令: sed -i "s/oldstring/newstring/g" filename,在当前目录下的filename文件中,查找oldstring并且把它替换成newstring. sed -i "s/oldstring/newstring/g" `ls`,这个是修改当前目录下的所有文件,查找oldstrin
小写转大写: [zengs@SYS SOS]$ for cpplive in *; do mv $cpplive `echo $cpplive|tr [a-z] [A-Z]`; done 大写转小写: [zengs@SYS SOS]$ for cpplive in *; do mv $cpplive `echo $cpplive|tr [A-Z] [a-z]`; done 修改后缀: [zengs@SYS SOS]$ for cpplive in *.JPG; do mv $cpplive