Word command not using word separators from settings
Since the update introducing the delimiters option, using the <Word> tag has been broken.
I've got it setup to only use a dash (-) to separate words when renaming, but since this update it no longer uses the dash it now ignores the dash and includes the words after the dash which has completely broken the usability of the function.
Example filename : Mavis Dracula - ZZ - 001.jpg
before the update using <Word:1> would return Mavis Dracula.
now it only returns Mavis.
I've got it setup to only use a dash (-) to separate words when renaming, but since this update it no longer uses the dash it now ignores the dash and includes the words after the dash which has completely broken the usability of the function.
Example filename : Mavis Dracula - ZZ - 001.jpg
before the update using <Word:1> would return Mavis Dracula.
now it only returns Mavis.
Reply to #1:
Weird. I can confirm that, even if you remove the space from the "Word separators:" setting, version 4.17 will still count a space as a word separator. A minor bug that I won't lose any sleep over.
But I humbly suggest that you use a better approach.
A) Restore the "Word separators:" list to it's default setting: " .,_-()[]{}!" (without the quotes but including the space).
That's because space is *THE* bedrock word separator in (¿almost?) every modern language -- and in the lexical, javascript, regex, etc. specs.
Ironically the standard dash is a word joiner! That is: "bad-grammar" is one word. This has nothing to do with the notion that those who cemented that standard paid their victims by the word. ;P
B) Use regex to explicitly define what you want. EG:
Replace: ([^-]+)-([^-]+)-([^-]+)
Replace with: word1 - word2 - word3 from $3, $2, $1
Use regular expressions: checked
Captures everything separated by dashes (this Q&D example assumes 2 dashes for brevity) into separate chunks that can be replaced or rearranged.
EG: "Mavis Dracula - ZZ - 001.jpg" becomes "word1 - word2 - word3 from 001, ZZ , Mavis Dracula .jpg"
See https://regex101.com/r/tMeP46/1 for an explanation of this example and to explore variations.
~~
There are other regex schemes that may serve you as well. And for awesome power, JavaScript approaches. Depending on your exact particulars, edge cases, and ultimate goals.
Weird. I can confirm that, even if you remove the space from the "Word separators:" setting, version 4.17 will still count a space as a word separator. A minor bug that I won't lose any sleep over.
But I humbly suggest that you use a better approach.
A) Restore the "Word separators:" list to it's default setting: " .,_-()[]{}!" (without the quotes but including the space).
That's because space is *THE* bedrock word separator in (¿almost?) every modern language -- and in the lexical, javascript, regex, etc. specs.
Ironically the standard dash is a word joiner! That is: "bad-grammar" is one word. This has nothing to do with the notion that those who cemented that standard paid their victims by the word. ;P
B) Use regex to explicitly define what you want. EG:
Replace: ([^-]+)-([^-]+)-([^-]+)
Replace with: word1 - word2 - word3 from $3, $2, $1
Use regular expressions: checked
Captures everything separated by dashes (this Q&D example assumes 2 dashes for brevity) into separate chunks that can be replaced or rearranged.
EG: "Mavis Dracula - ZZ - 001.jpg" becomes "word1 - word2 - word3 from 001, ZZ , Mavis Dracula .jpg"
See https://regex101.com/r/tMeP46/1 for an explanation of this example and to explore variations.
~~
There are other regex schemes that may serve you as well. And for awesome power, JavaScript approaches. Depending on your exact particulars, edge cases, and ultimate goals.
Reply to #1:
EDIT: Sorry, Randy beat me to it and I didn't see it. Here's another take : ) END EDIT
Hi Danny,
Sounds like it's working now and not before. Unless you've removed the space from your Settings (Settings / Renaming / Word separators:) the program SHOULD take "Mavis" as word 1 of that filename. Check that setting field and adjust it as needed.
You can also use the second parameter "count", to tell ARen how many words you want (<word:1:3> will take the first three words).
I'm using version 4.17, and I tried 4.11 and 3.95. With the exception of the "count" parameter they all worked correctly. The only problem I've found so far with the <word> tag is if you try to use a backslash or forward slash to change more than one word. You can get around that by using regex.
https://www.advancedrenamer.com/user_guide/v4/tags_default
Best,
DF
EDIT: Sorry, Randy beat me to it and I didn't see it. Here's another take : ) END EDIT
Hi Danny,
Sounds like it's working now and not before. Unless you've removed the space from your Settings (Settings / Renaming / Word separators:) the program SHOULD take "Mavis" as word 1 of that filename. Check that setting field and adjust it as needed.
You can also use the second parameter "count", to tell ARen how many words you want (<word:1:3> will take the first three words).
I'm using version 4.17, and I tried 4.11 and 3.95. With the exception of the "count" parameter they all worked correctly. The only problem I've found so far with the <word> tag is if you try to use a backslash or forward slash to change more than one word. You can get around that by using regex.
https://www.advancedrenamer.com/user_guide/v4/tags_default
Best,
DF
Reply to #3:
DF,
Did you try removing the space from the settings? It has no effect for me, so there is a bug here sort-of. (Space should be explicitly stated to always be counted as a word separator regardless of those settings.)
Best,
Randy
DF,
Did you try removing the space from the settings? It has no effect for me, so there is a bug here sort-of. (Space should be explicitly stated to always be counted as a word separator regardless of those settings.)
Best,
Randy
Reply to ALL
Thanks for the tips, I'm expressly encountering this error when using <Word> tag to create subfolders when moving files, used to work on earlier versions, but not anymore.
Doesn't look like you can use regex for folder creation.
Thanks for the tips, I'm expressly encountering this error when using <Word> tag to create subfolders when moving files, used to work on earlier versions, but not anymore.
Doesn't look like you can use regex for folder creation.
Reply to #3:
EDIT: Sorry Randy... I'm gonna take a coffee break then respond... :) END EDIT
Hey Randy,
Are you sure you don't have a space hiding in plain sight at the end of your "Settings / renaming / Word Separators:" field? When I tried removing the space it worked correctly in all three versions I tried (3.95, 4.11, 4.17). ???
But try replacing <word:1>\<word:2>\<word:3> (without regex of course). Seems to be a bug there. (Courtesy of Robbo Nafta's recent post).
Best,
DF
EDIT: Sorry Randy... I'm gonna take a coffee break then respond... :) END EDIT
Hey Randy,
Are you sure you don't have a space hiding in plain sight at the end of your "Settings / renaming / Word Separators:" field? When I tried removing the space it worked correctly in all three versions I tried (3.95, 4.11, 4.17). ???
But try replacing <word:1>\<word:2>\<word:3> (without regex of course). Seems to be a bug there. (Courtesy of Robbo Nafta's recent post).
Best,
DF
Reply to #5:
Sorry.
Maybe you can carefully change select spaces to a "safe" character (Maybe ~ (tilde)), create the folders and then change the safe character back to spaces?
Update: I can confirm that this works but it requires running 3 batch jobs: (1) Rename, (2) Move, (3) restore spaces.
There may be easier ways to do this. personally, I'd just use Powershell or Python. But I'm comfortable with those.
Sorry.
Maybe you can carefully change select spaces to a "safe" character (Maybe ~ (tilde)), create the folders and then change the safe character back to spaces?
Update: I can confirm that this works but it requires running 3 batch jobs: (1) Rename, (2) Move, (3) restore spaces.
There may be easier ways to do this. personally, I'd just use Powershell or Python. But I'm comfortable with those.
Reply to #6:
RE: "Are you sure you don't have a space hiding in plain sight..."
Yes, I made very sure of that. *Although* I could've swore removing the space worked the very first time I tried it. It failed to work on subsequent attempts as I tried to replicate behaviors. So something hinky is going on, at least with my setup...
RE: "Are you sure you don't have a space hiding in plain sight..."
Yes, I made very sure of that. *Although* I could've swore removing the space worked the very first time I tried it. It failed to work on subsequent attempts as I tried to replicate behaviors. So something hinky is going on, at least with my setup...