Remove "dots" in movie names
-
haaranoos
- Posts: 17
- Joined: 29 Apr 2017 11:53
Remove "dots" in movie names
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
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
-
highend
- Posts: 14923
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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: 66075
- 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
-
highend
- Posts: 14923
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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: 66075
- 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
-
highend
- Posts: 14923
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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: 66075
- 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
-
highend
- Posts: 14923
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Remove "dots" in movie names
Looks good to me
One of my scripts helped you out? Please donate via Paypal
-
haaranoos
- Posts: 17
- Joined: 29 Apr 2017 11:53
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)" };
-
haaranoos
- Posts: 17
- Joined: 29 Apr 2017 11:53
Re: Remove "dots" in movie names
Hello
I wanted to play smart and added one line more to remove extra Spaces (if any) too, but it didn't work!
Is this the right approach, or am I completely off the mark?
thank you
I wanted to play smart and added one line more to remove extra Spaces (if any) too, but it didn't work!
Is this the right approach, or am I completely off the mark?
thank you
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, "\.+", " ");
$newBase = regexreplace($base, "\s+", " ");
if ($newBase != $base) {
$cnt++;
renameitem($newBase, $video);
}
}
}
if ($cnt) { e "Renamed $cnt video file(s)" };-
highend
- Posts: 14923
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Remove "dots" in movie names
Ehm, my script already reduced all following spaces into one?
Since v27.20.0304 this works as well (for all selected items)
Since v27.20.0304 this works as well (for all selected items)
Code: Select all
rename "r", "\.+ > /b";One of my scripts helped you out? Please donate via Paypal
-
haaranoos
- Posts: 17
- Joined: 29 Apr 2017 11:53
Re: Remove "dots" in movie names
You are exactly right!
I updated my XYplorer, and all is fine!
Thank you very much
I updated my XYplorer, and all is fine!
Thank you very much
XYplorer Beta Club