How do I search multiple files with a '-' after 11 characters from the right side of every file?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
unrealdanio
Junior Member
Junior Member
Posts: 2
Joined: 2020-09-14, 18:25 UTC

How do I search multiple files with a '-' after 11 characters from the right side of every file?

Post by *unrealdanio »

Hi all,

As I'm new here, I'm not an average user of TC, but I've seen how powerful it is. I've successfully managed to do a bulk rename process of some files, but now here's where I really don't know where to start off. I'm guessing the topic sounds awful in trying to explain what I need help with, but to put it into simplification:

I need to bulk select files that contain 11 chars and end with a '-', all from the right side of the filename. e.g.:

Really Cool Artist - Really Cool Song-cgh5etyctVE.mp3.mp3
Another Artist - Another Song-XXP-ew2q1FI.mp3
Some Artist - Some Song-_m5u4WXRl14.mp3

The only special chars in these sequences are '-' and '_', the rest are low and up case letters and numbers. I've tried combining some stuff that I've read from the manual and some other topics from this forum and I still can't manage to get that selection done. :oops:

I'd be more than happy for any advice for the latter. I'm currently segregating my music library and it's a mess having these garbage texts hanging out of every filename I have on there.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: How do I search multiple files with a '-' after 11 characters from the right side of every file?

Post by *gdpr deleted 6 »

Based on your examples, what you seem to actually look for is a "-" with another 11 characters before a dot in the file name.

You can simply use a file pattern like

Code: Select all

*-???????????.*
as selection pattern. Pay attention to use the correct amount of "?" ;)



Depending on what you actually want to do with the files or if your search pattern becomes more complex, you could also use "Find files" function (Alt+F7) or Mutli-Rename-Tool (Ctrl+M) with a regular expression like this:

Code: Select all

-[^.]{11}\.
Explanation:

Code: Select all

-           The "-" character
[^.]{11}    [^.] means any character except a dot. "{11}" means 11 times. Thus, this matches a sequence of 11 characters that doesn't contain a dot.
\.          Literally the dot character "."
unrealdanio
Junior Member
Junior Member
Posts: 2
Joined: 2020-09-14, 18:25 UTC

Re: How do I search multiple files with a '-' after 11 characters from the right side of every file?

Post by *unrealdanio »

elgonzo wrote: 2020-09-14, 19:16 UTC Based on your examples, what you seem to actually look for is a "-" with another 11 characters before a dot in the file name.

You can simply use a file pattern like

Code: Select all

*-???????????.*
as selection pattern. Pay attention to use the correct amount of "?" ;)



Depending on what you actually want to do with the files or if your search pattern becomes more complex, you could also use "Find files" function (Alt+F7) or Mutli-Rename-Tool (Ctrl+M) with a regular expression like this:

Code: Select all

-[^.]{11}\.
Explanation:

Code: Select all

-           The "-" character
[^.]{11}    [^.] means any character except a dot. "{11}" means 11 times. Thus, this matches a sequence of 11 characters that doesn't contain a dot.
\.          Literally the dot character "."
Thanks a bunch elgonzo! The RegEx expression helped a lot, I've tried the question marks for the selection but no luck with that, but from here I've managed to make another window for searched files under the matched criteria, and then I used the multi-rename tool. I guess RegEx does come in handy. I'll have to put some more time into that.
Post Reply