This commit is contained in:
olari
2019-04-13 22:28:43 +03:00
commit cbf6cd3f07
19 changed files with 1066 additions and 0 deletions

33
python/bulk_renamer.py Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python3
# bulk file renamer that you interface with using intermediary text file.
import os
def setup_file():
files = open('files.txt', 'w')
for file in os.listdir('.'):
files.write(file + '\n')
def rename_files():
new_names = open('files.txt', 'r')
for file in os.listdir('.'):
new_name = str(new_names.readline()).rstrip('\n')
if (new_name == file) or new_name == "files.txt":
continue
os.rename(file, new_name)
print("bulk renamer by Olari.\n")
print("Generating files.txt")
print("Modify it to rename files\n")
setup_file()
input("Waiting for input...\n")
print("Renaming files")
rename_files()