用python脚本实现:
#-*- coding:utf-8 -*-
# coding: utf8
import os
import hashlib
from collections import Counter
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# 搜寻以下文件类型 (根据自己需求替换)
suf_set = ('.png', '.jpg', '.xib' , '.mm', '.swift', '.pch')
# 项目所在文件目录 (找到自己的项目文件目录)
project_path = '/Users/huibo1/Desktop/SYXImg'
# 文件重命名函数,返回新的文件名
def file_rename(file_path):
root_path = os.path.split(file_path)[0] # 文件目录
root_name = os.path.split(file_path)[1] # 文件名包含扩展名
filename = os.path.splitext(root_name)[0]; # 文件名
filetype = os.path.splitext(root_name)[1]; # 文件扩展名
new_path = os.path.join(root_path, pre_to_str+filename+filetype) # 拼接新路径
os.renames(file_path, new_path) # 文件重命名
return pre_to_str+filename
def get_md5_01(file_path):
md5 = None
if os