Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import glob
- import sys
- import os
- import shutil
- files = glob.glob("in/*.wav")
- if files == []:
- print("No files found in in/*.wav")
- sys.exit()
- for f in files:
- n = f.split(os.sep).pop()
- trunk, ext = os.path.splitext(n)
- chunks = trunk.split('-')
- moved = chunks.pop()
- chunks.insert(2, moved)
- newname = '-'.join(chunks)
- out = "out/%s%s" % (newname, ext)
- shutil.copy(f, out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement