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, re | |
path = 'C:/Users/Test/test' | |
pattern = '^([A-Z]+)\-([0-9]+).*$' | |
replace = r"\2-\1.mkv" | |
comp = re.compile(pattern) | |
for f in os.listdir(path): | |
full_path = os.path.join(path, f) | |
if os.path.isfile(full_path): |
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
@ECHO OFF | |
SET TARGET_DIR=%1 | |
SET EMPTY_DIR=$EMPTY_DIR$ | |
MKDIR %EMPTY_DIR% | |
ROBOCOPY %EMPTY_DIR% %TARGET_DIR% /PURGE | |
RMDIR %EMPTY_DIR% | |
RMDIR %TARGET_DIR% | |
ECHO Directory successfully removed |
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
@ECHO OFF | |
SET PATTERN=%1 | |
SET REPLACE=%2 | |
python %~dp0/regex_rename.py %PATTERN% %REPLACE% |