# -*- coding: utf-8 -*-
"""
Created on Fri Jan 18 12:37:21 2019

@author: daohe
"""

import re, os

for root, dirs, files in os.walk("."):
    for file in files:
        fixed = re.split("\.|_", str(file))
        try:
            fixed = f"{file[:10]}{fixed[4]}.{fixed[3]}.{fixed[2]}_{file[-16:]}"
        except Exception as e:
            print(e)
        print(f"old: {file}  new: {fixed}")
        os.system(f"mv {file} {fixed}")
