Replace the Characters

Any questions? Need some help?
Post Reply
Sarah30
Posts: 1
Joined: 19 Mar 2019, 16:04

Replace the Characters

Post by Sarah30 » 19 Mar 2019, 18:07

Hello,

Is there a possible way to replace the invalid characters in name while renaming with another characters?

For example, when renaming we see that :, ? etc. are invalid characters... so Filebot omits those characters. Now, instead of deleting those characters, can I replace colon (:) with dash (-) or question mark (?) with a exclamation mark (!) and so on?

Thanks
This is my Territory.....Be on your way

User avatar
rednoah
The Source
Posts: 15527
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Replace the Characters

Post by rednoah » 19 Mar 2019, 20:36

Yes, a few of the examples do just that:
https://www.filebot.net/naming.html

e.g.

Code: Select all

n.replace('?', '!')

Code: Select all

n.colon(' - ')

Code: Select all

t.removeAll(/[!?.]+$/)

Best to just use the {plex} binding though, because it does all of these cleanup operations implicitly:
viewtopic.php?f=5&t=4116
:idea: Please read the FAQ and How to Request Help.

User avatar
devster
Posts: 197
Joined: 06 Jun 2017, 22:56

Re: Replace the Characters

Post by devster » 20 Mar 2019, 23:11

If you want to be really fancy you can replace as follows:

Code: Select all

":" > ":"
"?" > "﹖"
Those are single characters, but it's possible it breaks... stuff...
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 15527
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Replace the Characters

Post by rednoah » 21 Mar 2019, 05:17

As a colon : replacement, I'd recommend ratio ∶
https://unicode-table.com/en/2236/
:idea: Please read the FAQ and How to Request Help.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests