Hello
I have a situation in some download sites where they have a tendency to use dots, like "Mymovie.To.you..When.mp4".
I want a script to remove those dots and make it nice and clean. Mymovie To you Wehn.mp4
ist it possbiel.
Thank you very much
Remove "dots" in movie names
Re: Remove "dots" in movie names
Code: Select all
$videos = quicksearch("/types={:Video}");
end (!$videos), "No video(s) found in the current folder (incl. subfolder(s)), aborted!";
setting "BackgroundFileOps", 0;
$cnt = 0;
foreach($video, $videos, <crlf>, "e") {
$base = gpc($video, "base");
if (regexmatches($base, "\.")) {
$newBase = regexreplace($base, "\.+", " ");
if ($newBase != $base) {
$cnt++;
renameitem($newBase, $video);
}
}
}
if ($cnt) { e "Renamed $cnt video file(s)" };
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 64849
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Remove "dots" in movie names
Or
rename s, "./ "; to do it for all selected list items.FAQ | XY News RSS | XY X
Re: Remove "dots" in movie names
Which does remove multiple following dots but not condense them into a single space
This could be made more efficient if there would be an option for the
Maybe a option box in the dialog window for it:
or
?
This could be made more efficient if there would be an option for the
RegExp Rename... to just operate on the base name (everything in a folder name, everything but excluding the . + ext in a file name).Maybe a option box in the dialog window for it:
[ ] Exclude extensionor
[ ] On base name only?
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 64849
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Remove "dots" in movie names
The "b", "s", and "k" modes all work on the base by default. I'm surprised that "r" does not. But okay, it's been like this forever and it's clearly documented in the help and in the interface.
Would there be any ambiguities if there was an option for a final
Would there be any ambiguities if there was an option for a final
/b switch appended to the regexp term, meaning it would only affect the base? (Asking for a friend who doesn't know regexp.) For example: o > n /b (replace all o by n, but only in the base)FAQ | XY News RSS | XY X
Re: Remove "dots" in movie names
As long as /b is the last part of the "to replace with" term and _only_ its leading space is removed before applying it, I don't see any problems using it
must all lead to different results
\. > <one space>/b\. > <two spaces>/b\. > <three spaces>/bmust all lead to different results
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 64849
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Remove "dots" in movie names
Cool. Next beta you can do this:
3 spaces, one from
PS: Ha! I taught the C tag to respect white space without collapsing it.
No more quotes necessary:
3 spaces, one from
Code: Select all
rename r, "\. > /b";" > ", one " " to replace with, one from " /b".PS: Ha! I taught the C tag to respect white space without collapsing it.
3 spaces, one from
> , one to replace with, one from /b.FAQ | XY News RSS | XY X
Re: Remove "dots" in movie names
Looks good to me
One of my scripts helped you out? Please donate via Paypal
Re: Remove "dots" in movie names
Thank you, fantastic reallyhighend wrote: ↑14 Nov 2025 01:08Code: Select all
$videos = quicksearch("/types={:Video}"); end (!$videos), "No video(s) found in the current folder (incl. subfolder(s)), aborted!"; setting "BackgroundFileOps", 0; $cnt = 0; foreach($video, $videos, <crlf>, "e") { $base = gpc($video, "base"); if (regexmatches($base, "\.")) { $newBase = regexreplace($base, "\.+", " "); if ($newBase != $base) { $cnt++; renameitem($newBase, $video); } } } if ($cnt) { e "Renamed $cnt video file(s)" };
XYplorer Beta Club