Rename TV Show Episode File: Replace '.' character with ''
#1
I am using the renamer module in EMM 1.5.0 and having an issue with the Episode File Pattern.  I have an episode where the title has an ellipsis at the end, and I would like it removed from the file name (or any '.' character in the title).  I am trying to use the replace command, and so far I have tried:

$W_?2?{ - $T$!$?.??}
$W_?2?{ - $T$!$?\.??}
$W_?2?{ - $T$!$?/.??}
$W_?2?{ - $T$!$?#.??}

None of these have worked.  The first version does work for alphanumeric characters.  Is there a way to make it work for the '.' character (or other special characters)?
Reply
#2
What the hell is an ellipsis? Please give me an example of a title or file name and what do you want as file name result.

The pattern system in the renamer is not regex, so you don't have to escape anything.
Reply
#3
(2021-01-10, 12:49)DanCooper Wrote: What the hell is an ellipsis? Please give me an example of a title or file name and what do you want as file name result.
Sure, I can give you some examples.  An ellipsis is the 3 or more periods that sometimes come at the end of a phrase.  So for an episode titled 'All Good Things...', the file name becomes '725 - All Good Things....mkv'.  Since periods are a special character in file names, I want to remove them from the title.  This would include uses other than ellipsis, like 'Vs.' or 'Mrs.' or whatever.

So, if I start with:

725 - All Good Things....mkv
106 - Mrs. X At The Gaslight.mkv

I want to end up with:

725 - All Good Things.mkv
106 - Mrs X At The Gaslight.mkv
Reply
#4
The newly released version 1.9.1 got an update on the renamer and does exactly that automatically: removing leading and trailing dots Smile Also leading to prevent the folder or file got hidden for the OS.

But you also can remove all dots inside a text if you use this at the end of a pattern:
Code:
$?.??

If you set it inside a {} then it will only be used if all flags inside the brakets will be available. You also have to set the flag to the end to do the replace after all other flags has ben set.

Image
Reply
#5
Ah, good that a new update scrubs these automatically on both ends.  Nice feature.

I updated to 1.9.1, moved the flag to the end (outside the {}) but it still wasn't working.  So I tried adding in periods elsewhere in the title, and those were removed correctly.  What I then realized was that the ellipsis was actually coded as the ellipsis character '\u2026' in the title (you can tell when the cursor moves from beginning to end in one keystroke, instead of in front of each dot), and was getting mapped to 3 periods in the filename. Since the auto scrub didn't work, I assume that must have happened afterward, probably by the OS file write command (because I assume the ellipsis character is not allowed in a filename).  Once I replaced the ellipsis with 3 periods in the title, the auto scrub worked.

For now, I can track down the few cases where an ellipsis character is in the title instead of 3 periods.  One easy solution for a future release might be to apply this mapping to scraped text fields at the time of scraping.  Unicode is good at introducing problems like this.  Yet another (minor) issue to tackle in your quest for the perfect media manager. Smile

Thanks!
Reply
#6
Very interesting! But i think the point is that this character is allowed as file or folder name, even is not nice. After generating the new file name i let the names run through a manuall replacing (e.g. ":" to " - ") and then through the "officiall" MS/.NET "not valid folder/file name characters" and at the end I manually remove all leading and trailing dots and spaces to get the final result. I'm shure if I whould add more custom replacings as you recommended than other user will scream "why!?!?!? I want this character!" ;-) I'm trying not to patronize the users so I probably won't be including this character. But it should be possible to replace it with another flag like
Code:
$?…??
(use ALT+0133 to add dots).
Reply



Logout Mark Read Team Forum Stats Members Help
Rename TV Show Episode File: Replace '.' character with ''0
This forum uses Lukasz Tkacz MyBB addons.