How can I chain two name changes in the title?
-
- Posts: 5
- Joined: 04 Sep 2020, 08:35
How can I chain two name changes in the title?
Hi,
I want to change the characters ¿ and ? for ¡ and !. If I use t.replace('?', '!') it works fine, but I can't add the other change.... Any idea?
I want to change the characters ¿ and ? for ¡ and !. If I use t.replace('?', '!') it works fine, but I can't add the other change.... Any idea?
Re: How can I chain two name changes in the title?
String.replace() yields a String value as a result, so you can chain them easily:
Code: Select all
'¿¡'.replace('¿', '?').replace('¡', '!')
Please read the FAQ and How to Request Help.
-
- Posts: 5
- Joined: 04 Sep 2020, 08:35
Re: How can I chain two name changes in the title?
Thanks.... but ....
t.replace('¿', '?').replace('¡', '!')?
t.'¿¡'.replace('¿', '?').replace('¡', '!')
Does not work for me....
t.replace('¿', '?').replace('¡', '!')?
t.'¿¡'.replace('¿', '?').replace('¡', '!')
Does not work for me....
Re: How can I chain two name changes in the title?
This will work:
Because this works:
I'm using the constant String value '¿¡' for test purposes. t is a variable that is a String value, so it'll work the same.
If you were to provide a specific episode as example for testing, then I could have used your example for illustration purposes. But in absence of that, I had to show how it works using a constant String value to serve as test data. Please read How to Request Help for details.
Code: Select all
t.replace('¿', '?').replace('¡', '!')
Code: Select all
'test 1 ¿ 2 ¡'.replace('¿', '?').replace('¡', '!')
If you were to provide a specific episode as example for testing, then I could have used your example for illustration purposes. But in absence of that, I had to show how it works using a constant String value to serve as test data. Please read How to Request Help for details.
Please read the FAQ and How to Request Help.
-
- Posts: 5
- Joined: 04 Sep 2020, 08:35
Re: How can I chain two name changes in the title?
I'm sorry, but for me doesn't work... here you have an exemple....
I have try with this one:
I have try with only one ¿ or ? and then it's ok, but with the two characters I can´t
Any idea?
I have try with this one:
Code: Select all
D/{n.colon(' - ')} ({y})/{'Season '+s}/{n.colon(' - ')} - {s00e00} - {t.replace('¿', '?').replace('¡', '!')}
Code: Select all
Dexter - S03E12 - ¿Tomas a Dexter Morgan-.avi
I have try with only one ¿ or ? and then it's ok, but with the two characters I can´t
Any idea?
Re: How can I chain two name changes in the title?
1.
As you can see in your screenshot, the first ¿ has been replaced with ? successfully:
2.
However on Windows ? is not allowed in file paths, so if your custom format is generating invalid file paths, then FileBot help fix them up by stripping the ? away.
You may want to remove ¿? in your custom format so that FileBot doesn't have to ask you about it later:
3.
This piece of code:
will generate this piece of text:
You'll want to use this piece of code:
to generate this piece of text with ¿? remove to make the file name Windows-compatible:
As you can see in your screenshot, the first ¿ has been replaced with ? successfully:
2.
However on Windows ? is not allowed in file paths, so if your custom format is generating invalid file paths, then FileBot help fix them up by stripping the ? away.
You may want to remove ¿? in your custom format so that FileBot doesn't have to ask you about it later:
Code: Select all
t.removeAll(/[¿?]/)
3.
This piece of code:
Code: Select all
{t.replace('¿', '?').replace('¡', '!')}
Code: Select all
?Tomas a Dexter Morgan?
Code: Select all
t.removeAll(/[¿?]/).replace('¡', '!')
Code: Select all
Tomas a Dexter Morgan
Please read the FAQ and How to Request Help.
-
- Posts: 5
- Joined: 04 Sep 2020, 08:35
Re: How can I chain two name changes in the title?
Hi, I have found the problem... I'm not explained very well....
{t.replace('¿', '¡').replace('?', '!')} will do what I want.... I tried it and all is OK..... that is change the ¿? characters for ¡!.....
Thanks for your help....
{t.replace('¿', '¡').replace('?', '!')} will do what I want.... I tried it and all is OK..... that is change the ¿? characters for ¡!.....
Thanks for your help....
Re: How can I chain two name changes in the title?
Just change the replacement value accordingly then:
Code: Select all
{t.replace('¿', '¡').replace('?', '!')}
Please read the FAQ and How to Request Help.
-
- Posts: 5
- Joined: 04 Sep 2020, 08:35
Re: How can I chain two name changes in the title?
Many, many thanks.