Page 1 of 1

Rename Special Chars

Posted: Wed Jan 27, 2021 12:22 am
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!

Re: Rename Special Charts

Posted: Wed Jan 27, 2021 9:05 am
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

Re: Rename Special Charts

Posted: Wed Jan 27, 2021 9:25 am
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

Re: Rename Special Chars

Posted: Wed Jan 27, 2021 10:22 am
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.

Re: Rename Special Chars

Posted: Wed Feb 03, 2021 12:21 pm
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"))

Re: Rename Special Chars

Posted: Wed Feb 03, 2021 1:54 pm
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.

Re: Rename Special Chars

Posted: Thu Feb 04, 2021 1:15 pm
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."