Wild cards in PATTERN?

Post any Bulk Rename Command support requirements here. Open to all registered users.

Wild cards in PATTERN?

Postby NickHark » Tue Jun 29, 2021 12:51 am

I have a folder containing the following files.

EnumMeanumMinumMo.txt
Blah Blah Blah.txt
062721a-Michael Berry Show-hr_1.txt
062721b-Michael Berry Show-hr_2.txt
062721c-Michael Berry Show-hr_3.txt
062721d-Michael Berry Show-6_25.txt
YadaYadaYada.txt

The items with the "062721x-" were created by BRC, thank you very much.

I want to add the created date to the front of the remaining files, but exclude the previously processed files beginning with the date and "-". I've been trying /Pattern matching,
but I can't come up with the wildcards to do it, e.g. /PATTERN:*-*.* or /PATTERN:*???????-*.* The dates will be different each day.

Am I barking up the wrong tree?
NickHark
 
Posts: 5
Joined: Sun Dec 01, 2013 10:11 pm

Re: Wild cards in PATTERN?

Postby NickHark » Tue Jun 29, 2021 4:58 pm

RE: further to my OP
My complete batch file looks like this.

My intent is to place the create date on the front of every other file that doesn't have it yet.

BRC64.exe /DIR:"Dummy Shows" /PATTERN:"*mb_am_hr_*.*" /AUTONUMBER:1:1:P:-:38:0 /APPENDDATE:C:P:::4: /REPLACECS:mb_am_:"Michael Berry Show-"

BRC64.exe /DIR:"Dummy Shows" /PATTERN:"*mb_podcast_*.*" /INSERT:d-:1 /APPENDDATE:C:P:::4: /REPLACECS:mb_podcast_:"Michael Berry PM Show-"

BRC64.exe /DIR:"Dummy Shows" /PATTERN:*???????-*.* /INSERT:e-:1 /APPENDDATE:C:P:::4: /NODUP
NickHark
 
Posts: 5
Joined: Sun Dec 01, 2013 10:11 pm

Re: Wild cards in PATTERN?

Postby therube » Tue Jun 29, 2021 7:37 pm

BRC can't be used as a pipe.
And its /PATTERN isn't that flexible (as in you can't use a REGEX to exclude file names starting with digits) [& it is case sensitive to boot].

So about the only thing I can think of would be to (temporarily) move the already named files into a different directory, then move them back again. (Or use 1 directory for un-renamed files, & another for renamed files, moving from 1 to the other once renamed?)


If you could know that you wouldn't have any filenames starting with digits, you could so something like:
/PATTERN:"A* B* C* ... Z* a* b* c* ... z*"
(... signifies a range, but you'd have to actually type each letter out, separately.)
therube
 
Posts: 1022
Joined: Mon Jan 18, 2016 6:23 pm

Re: Wild cards in PATTERN?

Postby therube » Tue Jun 29, 2021 7:50 pm

You could /CHANGECASE:U first, then you could eliminate a...z.
therube
 
Posts: 1022
Joined: Mon Jan 18, 2016 6:23 pm

Re: Wild cards in PATTERN?

Postby Luuk » Fri Jul 16, 2021 2:28 am

Its unfortunate, but I cannot understand what all of the prefixes to look like, after this renaming?
So this some different ways to forbid a prefix, when the create-date is already there...

This tries to prefix 'create-date + auto-number', but /RegExp will remove it when the create-date repeats...
brc64.exe /AutoNumber:1:1:P:-:38:0 /AppendDate:C:P:::4 /RegExp:"^(\d{6})[a-z]+-\1([a-z]+-.+):\1\2"
So if a file was already prefixed, nothing changes.

This to conduct the same, but using a new auto-number...
brc64.exe /AutoNumber:1:1:P:-:38:0 /AppendDate:C:P:::4 /RegExp:"^(\d{6})([a-z]+-)\1[a-z]+-(.+):\1\2\3"


EDIT:
Im just noticed that you probably just need to remove the very first * after /Pattern: to better match your filenames!
Then you might not even need /RegExp, because /Pattern would never conduct files starting with numbers anyways.
But this might depend on what to do for the new auto-number?
Luuk
 
Posts: 318
Joined: Fri Feb 21, 2020 10:58 pm


Return to BRC Support


cron