Page 1 of 1

Wild cards in PATTERN?

PostPosted: Tue Jun 29, 2021 12:51 am
by NickHark
I have a folder containing the following files.

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

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?

Re: Wild cards in PATTERN?

PostPosted: Tue Jun 29, 2021 4:58 pm
by NickHark
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

Re: Wild cards in PATTERN?

PostPosted: Tue Jun 29, 2021 7:37 pm
by therube
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.)

Re: Wild cards in PATTERN?

PostPosted: Tue Jun 29, 2021 7:50 pm
by therube
You could /CHANGECASE:U first, then you could eliminate a...z.

Re: Wild cards in PATTERN?

PostPosted: Fri Jul 16, 2021 2:28 am
by Luuk
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"

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?