We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6c35aa commit 247900eCopy full SHA for 247900e
FileSorter.py
@@ -0,0 +1,19 @@
1
+from rich import print
2
+import os
3
+
4
+FileArray = []
5
6
+for path in os.listdir(fr"{os.getcwd()}"):
7
+ if os.path.isfile(os.path.join(fr"{os.getcwd()}", path)):
8
+ FileArray.append(path)
9
+try:
10
+ for i in range(0, len(FileArray)):
11
+ if "." not in FileArray[i] or FileArray[i] == str(__file__):
12
+ continue
13
14
+ new_file_name = f"File-{i+1}.{str(FileArray[i]).split('.')[1]}"
15
+ os.rename(str(FileArray[i]), new_file_name)
16
+ print(f"Renamed {FileArray[i]} -> {new_file_name}")
17
18
+except Exception as exception:
19
+ print(f"[red]{exception}[/red]")
0 commit comments