shorten or remove common words

Advanced Renamer forum
#1 : 06/05-21 01:14
Shaun
Shaun
Posts: 7
i can't find the right search term so ill ask it here ....

i have some common works that come up in a filename, like AND, THE, OF .... etc
is there a way to either remove a word entirely or shorten in the way windows does like Progra~

thanks if you can explain how to do this like im 5

Shaun


06/05-21 01:14
#2 : 06/05-21 11:14
David Lee
David Lee
Posts: 1125
Easiest way of removing a list of common words will be to use a List replace method, with each word on a separate line. Check "Use regular expressions".

eg to remove "the":

Replace: " ?\bthe\b" with: nothing
etc
(Note the leading space - but don't include the quotes).

\b indicates a "word boundary" so this expression will match complete words only, plus an optional preceding space.

To shorten words similarly to Windows 8.3 filenames...

Replace: "\b[^ ]{5}\K[^ ]*" with: "~"

\K indicates that preceding matched characters are excluded from the final match so in this case 5 non-space characters at the start of each long word are retained and the remaining non-space characters are replaced by a single "~". Change the number in curly brackets as appropriate.

You can add this Regex to the same List replace method as above and you can save the entire batch for future use.


06/05-21 11:14 - edited 07/05-21 00:07