We have a pile of files, as follows
Tools Required:
- An environment capable of running bash commands, such as git bash or Mac terminal.
- AI chat tool, such as ChatGPT.
Getting Started:
Note: If you are unable to follow the steps in the text, you can scroll directly to the demonstration video at the end of the text for reference on all the details.
Open git bash in the directory. Enter the ls command to get a list of file names and save it as the first text file named 1.txt.
Then open the AI tool and have it translate the following content into English:
"4k漂亮小姐姐无缝循环旗袍美女壁纸图片_动态桌面壁纸图片_动态壁纸下载-元气壁纸(1).mp4"
"AoA MiNiskirt4性感女神壁纸图片_动态桌面壁纸图片_动态壁纸下载-元气壁纸(1).mp4"
....
We will directly save the results as a new text file, 2.txt.
Next, we need to merge these two texts line by line into a new text.
Enter this command in Git Bash.
paste -d ' ' 1.txt 2.txt > 3.txt
Remove the Windows line breaks in Vim.
:%s/^M//g
Add the command (can be done in vim) at the beginning of each line in file 3.txt.
:%s/^/mv /g
Get the new text file 3.txt.
Save and exit, then rename 3.txt to rename.sh.
Place this bash script in the directory where the files are stored, and execute the script in Git Bash.
bash rename.sh
We have now changed all the Chinese names to English names!
Demo video (Operating System: Windows 11):