Wildcard Characters Revisited

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Wildcard Characters Revisited Fri Feb 10, 2017 3:25 am • by klind
I have read in other posts that Mr. Noodle doesn't want any wildcard characters and in the places he mentions I would agree that they are probably not needed.

However, wildcard characters might be useful in the Patterns area. Here's an example:

I wish to rename a large number of files that currently are in the following format:

01 - filename aaa.ext
02 - filename aaa.ext
03 - filename ccc.ext

I am using the following action:

Rename with pattern: [date created] ~[source folder][name ⇔] ~[#][extension]

In the [name] field I have to set the following replace text patterns:

Replace 0 with (nothing)
Replace 1 with (nothing)
Replace 2 with (nothing)
Replace 3 with (nothing)
Replace 4 with (nothing)
Replace 5 with (nothing)
Replace 6 with (nothing)
Replace 7 with (nothing)
Replace 8 with (nothing)
Replace 9 with (nothing)
Replace (space)-(space) with (space)

In order to get the naming convention I desire. I contend that in these Pattern Replace Text fields it would be much easier to allow for the use of wildcard characters such that I could reduce the above complicated replacement code with one line of code such as the following:

Replace ??(space)-(space) with (space)

Unless, of course, I am missing something. If so, please advise.
klind
 
Posts: 64
Joined: Mon Jan 30, 2017 7:02 pm

Re: Wildcard Characters Revisited Fri Feb 10, 2017 12:28 pm • by Mr_Noodle
I'm not sure how a wildcard would help in the replace section. Why not instead have a "Name matches" condition which grabs the part of the name after the number/dash?
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Wildcard Characters Revisited Fri Feb 10, 2017 3:23 pm • by klind
What would I match on? I have 200,000 photos I'm trying to rename with year-month-date followed by whatever and all the names are different; many, but not all with leading dumb numbers and others without numbers and basically a mess which I inherited from about thirty other family members. What I was trying to describe was just an example. Hazel IS doing the work for me, but I seem to have to make a lot of replace statements when a wildcard character would be advantageous in the replace area. Just an opinion.
klind
 
Posts: 64
Joined: Mon Jan 30, 2017 7:02 pm

Re: Wildcard Characters Revisited Mon Feb 13, 2017 12:24 pm • by Mr_Noodle
You could do a match like "(number) - (number) (•the real file name)". When renaming, use (•the real file name) which would be everything after the part you want to omit. It's a better way to accomplish what you are trying to do in with "replace text".
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Wildcard Characters Revisited Thu Feb 16, 2017 12:02 am • by klind
thanx... I'll give that a go...
klind
 
Posts: 64
Joined: Mon Jan 30, 2017 7:02 pm


Return to Support