How to auto-space between recognizable words and remove..

Bulk Rename Utility How-To's

How to auto-space between recognizable words and remove..

Postby amazing » Thu Sep 23, 2021 9:02 am

Code: Select all
ProductAnalysisTemplateShowerAdultTent20088504193021-210821-195918


Output
Code: Select all
Product Analysis Template Shower Tent



is this possible? If yes, how?
amazing
 
Posts: 12
Joined: Sat Jul 31, 2021 4:38 am

Re: How to auto-space between recognizable words and remove..

Postby Luuk » Thu Sep 23, 2021 4:22 pm

The Add(7) "Word Space" can insert "space" inbetween all of those lowercase and then a Capital letter.
To remove all-symbols and all-digits, can put checkmarks inside of Remove(5) for "Sym." and "Digits".
To remove trailing digits or hyphens at the very end, the Regex(1) can use a 'Match' and 'Replace' like...
^(.+?)[\d-]+$
\1
Luuk
 
Posts: 691
Joined: Fri Feb 21, 2020 10:58 pm

Re: How to auto-space between recognizable words and remove..

Postby amazing » Thu Sep 23, 2021 10:35 pm

Thanks! How do I prevent it from removing the first 1 or 2 numbers if there's a prefix though?

Lastly, is there any way I can save all these settings as a template, so I can easily toggle between them when needed?
amazing
 
Posts: 12
Joined: Sat Jul 31, 2021 4:38 am

Re: How to auto-space between recognizable words and remove..

Postby Luuk » Thu Sep 23, 2021 11:23 pm

First to describe either the filenames and what should stay, or what does mean "prefix"?
The RegEx(1) 'Match' and 'Replace' does only remove numbers or hyphens from the very end.
The Remove(5) with a checkmark inside for "Digits" will remove all of the numbers anywhere.

To save all of the current settings, there is menu "File, Save As" and then just choose a name to save it.
So then when needing it again, can use the menu "File, Open", and then select one of your saved names.
Luuk
 
Posts: 691
Joined: Fri Feb 21, 2020 10:58 pm

Re: How to auto-space between recognizable words and remove..

Postby amazing » Fri Sep 24, 2021 1:46 am

the word space is hit and miss though. is there any way to improve the results?

Image
Image
Image



not sure why the numbers are not filtered in this case too..
Image
amazing
 
Posts: 12
Joined: Sat Jul 31, 2021 4:38 am

Re: How to auto-space between recognizable words and remove..

Postby Luuk » Fri Sep 24, 2021 11:06 pm

"Word Space" only inserts spaces, and always before capital letters or at the very beginning, with no exceptions being granted.
To add spaces and capitalize depending on a word-list, you would have to create this list, and then use it inside of another setting.
One example could be using the Replace(3) with a "Replace" and "With" like...
Howto|Checkfor|...
HowTo|CheckFor|... (so then letting Word Space see the capital letters)

Another way...
Howto|Checkfor|...
How to |Check for |... (if not liking "for" and "to" starting with capital letters)

The RegEx(1) wont remove a suffix with () or spaces, because it only destroys numbers and hyphens, like the first example.
To destroy trailing numbers or hyphens and an optional trailing ' (number)' the "Match" and "Replace" could be like...
^(.+?)[\d-]+( \(\d\))?$
\1
Luuk
 
Posts: 691
Joined: Fri Feb 21, 2020 10:58 pm

Re: How to auto-space between recognizable words and remove..

Postby Luuk » Sat Sep 25, 2021 11:42 pm

"Word space" does only insert spaces before each capital letter, except when its at the very beginning.
Since were not allowed to say more exceptions, Im thinking its easier to conduct this with a 'v2' regex?
So for the examples, it could be a "Match" and "Replace" looking something like...

(?<![- \d]) *[-\d]+( \(\d+\))?$(?X)([a-z\d])(?<!Mc)([A-Z])/g(?X)Howto(?X)Checkfor(?X)\b(IP|ROI)(?=[A-Z])(?X)
(?X)$1 $2(?X)How to(?X)Check for(?X)$1 (?X)

The (?<!Mc) is a negative-lookbehind, so that names like RonaldMcDonald can stay like "Ronald McDonald".
And with a checkmark inside "v2", the regex grants saying many more exceptions, if its to be needed?
Luuk
 
Posts: 691
Joined: Fri Feb 21, 2020 10:58 pm


Return to How-To