Skip to content

Instantly share code, notes, and snippets.

@github-shakti
Last active September 10, 2017 22:16
Show Gist options
  • Select an option

  • Save github-shakti/afc6700456caaa85dba5 to your computer and use it in GitHub Desktop.

Select an option

Save github-shakti/afc6700456caaa85dba5 to your computer and use it in GitHub Desktop.
Xiaomi Call Rec Batch Rename
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