Rename Special Chars

Questions and answers on how to get the most out of FFAStrans
Post Reply
taurojo
Posts: 35
Joined: Mon Dec 19, 2016 2:44 pm

Rename Special Chars

Post by taurojo »

Hi,

Thanks for your support!!
I need rename final name file whitout special charts and spaces in name.

I use Command to send actions finals in workflow:
%comspec% /c "move /y "%s_original_full%" ....

At momente i use AntRename.But i like do in worflow FFAStrans. I dont like save to folder and rename.

How change name whit spaces or special charts, accents... etc. inside FFAStrans.

Thanks!
ThomasM
Site Admin
Posts: 231
Joined: Wed Feb 22, 2017 6:36 am

Re: Rename Special Charts

Post by ThomasM »

Hi Taurojo,

maybe this could be a starting point:

you can try it with PopulateVariables-Node and a RegEx-Function:

Code: Select all

([a-zA-Z\d]*)
In the PopulateVariables-Node create a new UserVariable, e.g. SaveWithoutSpecialCchar

Set the new UserVariable to RegEx-Function

Code: Select all

$regext("%s_original_name%","([a-zA-Z\d]*)")
This should extract a to z / A to Z AND Digits 0 to 9 from the filename.

In the DeliveryNode you drop originalName and set SaveWithoutSpecialCchar as prefix.

just my 2cent...

regards
Thomas
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Rename Special Charts

Post by emcodem »

@ThomasM yeeey, regex! lovely :D

using a populate vars processor, you can either use what thomasm said or use the inbuilt function alrep https://www.ffastrans.com/wiki/doku.php ... _and_alrep
emcodem, wrapping since 2009 you got the rhyme?
taurojo
Posts: 35
Joined: Mon Dec 19, 2016 2:44 pm

Re: Rename Special Chars

Post by taurojo »

Hi,

Work perfect for my!!! Add character _ in regex.

Test in: https://regex101.com/

Finaly: $regext("%s_original_name%","([a-zA-Z\d_]*)")

Thanks for all.
taurojo
Posts: 35
Joined: Mon Dec 19, 2016 2:44 pm

Re: Rename Special Chars

Post by taurojo »

Hi,

In the end it is not what I needed to be able to rename and have the output be a name suitable for web servers.

For now I am using this function... somewhat long .
If you have any better ideas :geek:

Code: Select all

$lower($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace("%s_original_name%", "ā","a"), "ţ","t"), "ş","s"), "ḑ","d"), "ḑ","d"), "ầ","a"), "ằ","a"), "ắ","a"), "ư","u"), "ẵ","a"), "ạ","a"), "ơ","o"), "ề","e"), "ồ","o"), "ộ","o"), "ỉ","i"), "ệ","e"), "ậ","a"), "ị","i"), "ả","a"), "ế","e"), "ừ","u"), "‘","_"), "’","_") , "ʼ","_"), "ḩ","h"), " ","_"), "ḩ" ,"h"), "á","a"), "à","a"), "è","e"), "é","e"), "í","i"), "ó","o"), "ú","u"), "ñ","ny"), "à","a"), "è","e"), "ì","i"), "ò","o"), "ù","u"), "ä","a"), "ë","e"), "ï","i"), "ö","o"), "ü","u"), "â","a"), "ê","e"), "î","i"), "ô","o"), "û","u"))
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Rename Special Chars

Post by emcodem »

:lol:
No its good, i like it. Thats more or less excatly what i do in lots of different programs where the customer wants me to replace special chars to some non special char that looks compareable. Unfortunately i am not aware of any ready to use functions for it. The reason might be that the expectation might be different for many parties, e.g. Germans want to translate "ü" to "ue" because ue is officially an alternate writing style for "ü". Others would not care and just translate "ü" to "u" because it looks similar hehe

Let me know if you need to alter this list frequently, in this case i can come up with a special processor for you that eases your life. I imagine it needs a little time to get all the parantheses correctly hehe

Also in 1.2, the populate processor allows you to have as many lines as you wish, this can also bring a better overview to you.
emcodem, wrapping since 2009 you got the rhyme?
taurojo
Posts: 35
Joined: Mon Dec 19, 2016 2:44 pm

Re: Rename Special Chars

Post by taurojo »

No problem whit that script, create do whith Notepad and simple macro :mrgreen:


I like it:
"Also in 1.2, the populate processor allows you to have as many lines as you wish, this can also bring a better overview to you."
Post Reply