I have 1000+ files in 2 folders(same amount).
EXAMPLE
Folder1/
0.json
1.json
2.json
Folder2/
some_name1.xml
some_name2.xml
some_name3.xml
I want to rename all files in 1st folder based on second folder file names BUT NOT THE EXTENSIONS
I got this script. It must just rename all files one by one But now it got a problem , after renaming files there are shuffled which means information are not same as files in folder1. Any ideas how to fix that?
from pathlib import Path
src = Path(r"/home/folder2")
dst = Path(r"/home/folder1")
for s, d in zip(src.iterdir(), dst.iterdir()):
d.rename(d.with_name(s.with_suffix(d.suffix).name))