Last active
September 10, 2017 22:16
-
-
Save github-shakti/afc6700456caaa85dba5 to your computer and use it in GitHub Desktop.
Xiaomi Call Rec Batch Rename
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| files = os.listdir(os.getcwd()) | |
| print files | |
| for index in range(len(files)): | |
| files[index].split('@',1) | |
| extension=files[index].split('@',1)[1][-4:] | |
| print files[index].split('_',1)[1][:4]+" "+files[index].split('_',1)[1][4:6]+" "+files[index].split('_',1)[1][6:8]+" "+files[index].split('_',1)[1][8:14]+" _ "+files[index].split('_',1)[0]+files[index].split('_',1)[1][-4:] | |
| oldname=files[index] | |
| newname=files[index].split('_',1)[1][:4]+" "+files[index].split('_',1)[1][4:6]+" "+files[index].split('_',1)[1][6:8]+" "+files[index].split('_',1)[1][8:14]+" _ "+files[index].split('_',1)[0]+files[index].split('_',1)[1][-4:] | |
| os.rename(oldname,newname) | |
| print "Script Executed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment