test.one.two_three.TXT ======> Test One Two Three.txt (For batch folder and files)
Replace dots with space, _ with space, lower extension, first letter of all word uppercase, lower extension.
1) Can it be done by mouse middle click button (after selecting files/folders) ?
2) If not then provide me script.
i tried using chatgpt for script but failed for hours, dont have technical knowledge.
thanks.
xyplorer version 27.00.0800
Neeed a script or method to batch rename file+folder, test.one.two_three.TXT ======> Test One Two Three.txt
-
shuklaharshit75
- Posts: 42
- Joined: 10 Aug 2024 10:12
Re: Need a script or method to batch rename file+folder, test.one.two_three.TXT ======> Test One Two Three.txt
Here's one lazy way to achieve it,
rename s, "._> "; #126;-
shuklaharshit75
- Posts: 42
- Joined: 10 Aug 2024 10:12
Re: Neeed a script or method to batch rename file+folder, test.one.two_three.TXT ======> Test One Two Three.txt
i used chatgpt and your given script. here is short summary. but coudnt Collapses multiple spaces into one and Removes trailing spaces.???
1) FOR FILE RENAMING=
rename s, ".-_ > "; #126; #113;
What it does:
Replaces ., _, and - with spaces
Capitalizes only the first word, rest lowercase (#126)
Copies the base name (without extension) to clipboard (#113)
Example:
Before:
my_file-name.TXT
After rename:
My file name.txt
Copied to clipboard:
My file name
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2) FOR FOLDER RENAMING=
rename s, ".-_ >_"; #128; rename s, " >_"; #113;
Step-by-Step Explanation:
rename s, ".-_ >_"
➡ Replaces dot (.), underscore (_) already present, and dash (-) with a single underscore
#128
➡ Capitalizes every word AND converts everything to UPPERCASE
Example: my name → MY NAME
rename s, " >_"
➡ Replaces spaces (added during capitalization) with underscores → MY_NAME
#113
➡ Copies the base name only (no extension) to clipboard
Example:
Input:
perl
Copy
Edit
my-file_name.test.txt
After Rename:
css
Copy
Edit
MY_FILE_NAME_TEST.txt`
Copied to Clipboard:
1) FOR FILE RENAMING=
rename s, ".-_ > "; #126; #113;
What it does:
Replaces ., _, and - with spaces
Capitalizes only the first word, rest lowercase (#126)
Copies the base name (without extension) to clipboard (#113)
Before:
my_file-name.TXT
After rename:
My file name.txt
Copied to clipboard:
My file name
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2) FOR FOLDER RENAMING=
rename s, ".-_ >_"; #128; rename s, " >_"; #113;
Step-by-Step Explanation:
rename s, ".-_ >_"
➡ Replaces dot (.), underscore (_) already present, and dash (-) with a single underscore
#128
➡ Capitalizes every word AND converts everything to UPPERCASE
Example: my name → MY NAME
rename s, " >_"
➡ Replaces spaces (added during capitalization) with underscores → MY_NAME
#113
➡ Copies the base name only (no extension) to clipboard
Input:
perl
Copy
Edit
my-file_name.test.txt
After Rename:
css
Copy
Edit
MY_FILE_NAME_TEST.txt`
Copied to Clipboard:
Re: Neeed a script or method to batch rename file+folder, test.one.two_three.TXT ======> Test One Two Three.txt
You didn't originally ask for multiple spaces to be changed to single, or for trailing spaces removed so I didn't offer that, anyway below is a untested (I'm on my phone) mod, it's still a lazy ver though instead of me scripting it properly.shuklaharshit75 wrote: ↑09 Jul 2025 20:39 i used chatgpt and your given script. here is short summary. but coudnt Collapses multiple spaces into one and Removes trailing spaces.???
Code: Select all
rename s, "-._> "; rename r, "\s+ > "; rename r, "\s+(\.[^.]+?$|$) > $1"; #126;
XYplorer Beta Club