Subject: Re: [Name Mangler Talk] Re: adding multiple items in "find" field?

From: Rob Griffiths <[email-masked]>
Date: Wed, 7 Dec 2011 11:08:47 -0800

On Dec 7, 2011, at 10:35 AM, Erick wrote:

> Thanks for responding so quickly. Below are before-n-after examples
> 
> BEFORE:
> item01_top.jpg
> item02_bottom.jpg
> item03_angle.jpg
> item04_side.jpg
> 
> AFTER:
> item01.jpg
> item02.jpg
> item03.jpg
> item04.jpg
> 
> So basically i'm doing a find/replace for this example. I'd like the
> ability to find "_top, _bottom, _angle, _side" and replace with
> nothing, which would just remove them. Just don't know if you can type
> in multiple search terms at once.

You can do this using regular expressions, which aren't necessarily the most approachable things, but are very powerful. In this case, assuming your filenames always match the pattern in your example, you just need to find "all characters at and beyond the underscore" and remove them. That query looks like this in find/replace:

Find: _.+
Repl: leave blank
[√] Query is a regular expression
[√] Ignore case

A screenshot at the end shows how it will affect your sample filenames.

VERY IMPORTANT: This assumes that your filenames have one and only one underscore, and that you want to remove everything at and after the underscore.

If, on the other hand, your filenames have multiple underscores, and you only want to remove everything at and after the last one, then you need this more-complex version (courtesy of Peter Maurer, our founder and programmer; such regex magic is beyond me!):

Find: _[^_]+$
Repl: leave blank
[√] Query is a regular expression
[√] Ignore case

As always, _please_ test on a copy of your files before committing this to permanency!

regards,
-rob.

----------

---

From: Erick <[email-masked]>
Date: Wed, 7 Dec 2011 10:35:56 -0800 (PST)

BEFORE:
item01_top.jpg
item02_bottom.jpg
item03_angle.jpg
item04_side.jpg

AFTER:
item01.jpg
item02.jpg
item03.jpg
item04.jpg

On Dec 7, 1:20 pm, Rob Griffiths <[email-masked]> wrote:
> On Dec 7, 2011, at 9:26 AM, Erick wrote:
>
> > Is there a way to add multiple items in a field? For example, a group
> > of file may contain different words at the end of the file name, such
> > as "top, bottom, front etc.). Is there a way to search them all at
> > once and replace with one thing? Thank you.
>
> It really depends on exactly what your filenames look like, and what you'd like them to look like. My tentative answer is "yes," but it would help greatly if you could send a sampling of before-and-after filenames, so I can provide a better answer.
>
> thanks;
> -rob.

---

From: Rob Griffiths <[email-masked]>
Date: Wed, 7 Dec 2011 10:20:35 -0800

thanks;
-rob.

---

From: Erick <[email-masked]>
Date: Wed, 7 Dec 2011 09:26:11 -0800 (PST)