-and the inclusion of this mode of renaming into scripting would be of a great help considering the eventual changes to come...
Thanks for considering.
Just added it. Even simpler. >>> is not necessary.SkyFrontier wrote:">>" for current pattern and ">>>" for more complex operations? Sounds good to me. Hope I'm not the only guy in the XY universe who needs to constantly translate files from different portions of the globe into "PC friendly" language...![]()
-and the inclusion of this mode of renaming into scripting would be of a great help considering the eventual changes to come...
Thanks for considering.
Code: Select all
+ Rename Special | Search and Replace: Now you can specify
lists with units larger than one character. Also different
lengths of old a new string are now allowed in such lists.
To enable this functionality simply separate the individual
units with | (pipe).
Examples:
Ä|Ö|Ü|ä|ö|ü>>Ae|Oe|Ue|ae|oe|ue
&| |->>and|space|hyphen
Copy|of>>Kopie|von
Any excess units on either side are ignored.I am interested.admin wrote:If there's a demand I can add the possibility to replace many chars of different lengths.
But the patterns will look a bit clumsy since we need to have a separator.
We could use ">>>" to mark this from of syntax, e.g.:Code: Select all
ä|ö|ü>>>ae|oe|ue
Code: Select all
"ä>ae|ö>oe|ü>ue| on > off |2>Two| Three >3"Not bad, thanks for the tip!jeduardo wrote:To remove diacritics all you need is API Function FoldStringW Lib "kernel32".
It will unfold á into a´. Then remove the diacritics be removing characters &H300 To &H36F.
Sample Input
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
Sample Output
AAAAAAÆCEEEEIIIIÐNOOOOOaaaaaaæceeeeiiiiðnooooo÷øuuuuyþy
Code: Select all
()!$'?:,&+-ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ>>___________SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyyCode: Select all
FINAL (OUT: >|<"):
?>G; !>l
Σ|•|—|¬|@|#|$|%|¨|*|{|}|[|]|\|/|=|;|.|^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_
Σ•—¬@#$%¨*{}[]\/=;.^~£₢&()!$'?:,&+-ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ">>______________________ce__l__G_____SOZsozYYuAAAAAAECEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy_
?>_; !>l; Æ>E; ₢>c; &>e; ">_
Σ•—¬@#$%¨*{}[]\/=;.^~£₢&()!$'?:,&+-ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ">>______________________ce__l________SOZsozYYuAAAAAAECEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy_
Code: Select all
rename s, "´|Ã|Σ|•|—|¬|@|#|$|%|¨|*|{|}|[|]|\|/|=|;|.|^|~|£|₢|&|(|)|!|$|'|?|:|,|&|+|-|Š|Œ|Ž|š|œ|ž|Ÿ|¥|µ|À|Á|Â|Ã|Ä|Å|Æ|Ç|È|É|Ê|Ë|Ì|Í|Î|Ï|Ð|Ñ|Ò|Ó|Ô|Õ|Ö|Ø|Ù|Ú|Û|Ü|Ý|ß|à|á|â|ã|ä|å|æ|ç|è|é|ê|ë|ì|í|î|ï|ð|ñ|ò|ó|ô|õ|ö|ø|ù|ú|û|ü|ý|ÿ>>_|o|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|cr|And|_|_|l|_|_|G|_|_|_|_|_|S|O|Z|s|o|z|Y|Y|u|A|A|A|A|A|A|AE|C|E|E|E|E|I|I|I|I|D|N|O|O|O|O|O|O|U|U|U|U|Y|s|a|a|a|a|a|a|a|c|e|e|e|e|i|i|i|i|o|n|o|o|o|o|o|o|u|u|u|u|y|y";
rename s, " /_"; rename s, "_____/_"; rename s, "____/_"; rename s, "___/_"; rename s, "__/_"; rename s, "_ _/_"; rename s, "_./.";
Code: Select all
//Renaming Dictionary
rename s, "´|Σ|•|—|¬|@|#|$|%|¨|*|{|}|[|]|\|/|=|;|.|^|~|£|₢|&|(|)|!|$|'|?|:|,|+|-|Š|Œ|Ž|š|œ|ž|Ÿ|¥|µ|À|Á|Â|Ã|Ä|Å|Æ|Ç|È|É|Ê|Ë|Ì|Í|Î|Ï|Ð|Ñ|Ò|Ó|Ô|Õ|Ö|Ø|Ù|Ú|Û|Ü|Ý|ß|à|á|â|ã|ä|å|æ|ç|è|é|ê|ë|ì|í|î|ï|ð|ñ|ò|ó|ô|õ|ö|ø|ù|ú|û|ü|ý|ÿ>>_|_|_|_|_|_|_|_|Perc|_|_|_|_|_|_|_|_|_|_|_|_|_|_|cr|And|_|_|l|_|_|G|_|_|_plus_|_|S|O|Z|s|o|z|Y|Y|u|A|A|A|a|A|A|AE|C|E|E|E|E|I|I|I|I|D|N|O|O|O|O|O|O|U|U|U|U|Y|s|a|a|a|a|a|a|a|c|e|e|e|e|i|i|i|i|o|n|o|o|o|o|o|o|u|u|u|u|y|y";
rename s, " /_"; rename s, "_____/_"; rename s, "____/_"; rename s, "___/_"; rename s, "__/_"; rename s, "_ _/_"; rename r, "_\. > .";
Code: Select all
v8.90.0001 - 2010-03-11 21:38
+ Rename Special: Added command
Remove Diacritics (ä > a ...)
Strips any diacritical marks from the letters in the selected item
names.
Thanks. Also reminded an old trick you taught me regarding regexreplace, this may come handy too.TheQwerty wrote:Give this a try, it should give you the same results (and I think it might be easier to maintain)...
EDIT: Or don't.. I'm stupid and hardly ever use Search & Replace... give me a minute..
Code: Select all
$out = RegexReplace($out, 'Ù|Ú|Û|Ü', 'u');Code: Select all
"Take 2"
//Removed "*\/?:" from the list, since they cannot be in filenames anyhow.
//Removed "ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ" because Remove Diacritics handles them as desired.
//Re-ordered search and replace characters (alphbetical by desired replacement.
//Separated into a separate rename all of the items that are replaced by underscore.
//Changed consecutive renaming to handle '_' combinations to one which will collapse any number of ' ' or '_' to a single '_'.
rename s, "+|Æ|æ|&|₢|Ð|?|!|Œ|Ø|ð|œ|%|ß|µ|¥>>_plus_|AE|a|And|cr|D|G|l|O|O|o|o|Perc|s|u|Y";
rename s, "´Σ•—¬@#$¨{}[]=;.^~£()$',->_";
#139; //Remove Diacritics
rename r, '[ _]+ > _'; //Collapses one or more ' ' or '_' to a single '_'.