Subject: Re: [Name Mangler Talk] Help with renaming files in sequence

From: Marino Arturo <[email-masked]>
Date: Sat, 12 Sep 2015 18:47:45 -0700 (PDT)

Thanks! this works great!

I love your software, you do a great job, Moom is awesome.

On Saturday, September 12, 2015 at 7:26:22 PM UTC-4, Many Tricks wrote:
>
> On Sep 12, 2015, at 3:52 PM, Marino Arturo <[email-masked] 
> <javascript:>> wrote: 
>
> > I'm trying to rename all the files inside a folder with the following 
> format: 
> > ParentFolderName_JAN_2015_0001.JPG 
>
> Makes sense. 
>
> > 1. The option to add a date doesn't have a MMM month format 
>
> Date formatting is somewhat limited, I agree. A future update will 
> hopefully add more control (no timeframe for that, though). But keep 
> reading, it's solvable. 
>
> > 2. I can not use underscores to separate the YYYY year from the date 
>
> Again, more control will be coming. But also again, it's solvable—keep 
> reading! 
>
> > Is there any way to do this without using the advance panel? 
>
> Yes, there is, thanks to regular expressions, which are a way of searching 
> for and manipulating text within a string. Download the attached zip file, 
> unzip, and double click, and it will open in Name Mangler 3. (I believe 
> this problem is solvable in Name Mangler 2, but the attached file only 
> works with Name Mangler 3. Name Mangler 2 would require advanced mode, as 
> that's the only way to do multi-step renaming.) 
>
> *** PLEASE TEST ON A COPY OF YOUR FILES! *** 
>
> Basically, you need a two-step sequence, where step one adds a sequence 
> number and places the date (formatted as Mmm d[d], YYYY) and separators, 
> and step two manipulates the date into what you want. Here's what it looks 
> like, set up to work on a set of sample files: 
>
>

---

From: Rob Griffiths <[email-masked]>
Date: Sat, 12 Sep 2015 16:26:18 -0700

On Sep 12, 2015, at 3:52 PM, Marino Arturo <[email-masked]> wrote:

> I'm trying to rename all the files inside a folder with the following format:

Makes sense.

> 1. The option to add a date doesn't have a MMM month format

Date formatting is somewhat limited, I agree. A future update will hopefully add more control (no timeframe for that, though). But keep reading, it's solvable.

> 2. I can not use underscores to separate the YYYY year from the date

Again, more control will be coming. But also again, it's solvable—keep reading!

> Is there any way to do this without using the advance panel?

Yes, there is, thanks to regular expressions, which are a way of searching for and manipulating text within a string. Download the attached zip file, unzip, and double click, and it will open in Name Mangler 3. (I believe this problem is solvable in Name Mangler 2, but the attached file only works with Name Mangler 3. Name Mangler 2 would require advanced mode, as that's the only way to do multi-step renaming.)

Basically, you need a two-step sequence, where step one adds a sequence number and places the date (formatted as Mmm d[d], YYYY) and separators, and step two manipulates the date into what you want. Here's what it looks like, set up to work on a set of sample files:

And here's the content of the Find and Replace strings...

Find:      (.*_)([A-Z][a-z][a-z])\ [0-9]+,\ (.*)
Replace: $1\U$2_$3

The way this works is that anything within (parens) in regular expressions are treated as variables, with the first becoming $1, the next $2, etc. Looking at the Find in pieces, it works like this:

(.*_)                  => Find everything, and put it in $1, but stop finding when you hit...
([A-Z][a-z][a-z]) => ...a capital letter followed by two lower case letters (and save in $2), but only if...
\ [0-9]+,\           => ...the three letters are followed by a space, then at least one digit, a comma,
                               and a space. This bit is *not* saved, because we don't need it, so it's not in parens.
(.*)                    => Everything else (i.e. the sequence number, as that's all that's left) is stored in $3

With that work done, the replacement is relatively straightforward:

$1                      => The saved path to the parent folder.
\U$2_                 => The month name, capitalized with \U, and followed by an underscore
$3                      => The sequence number

This should do what you want—as seen in the above screenshot, my renamed files match your desired template. But as noted, please test on a copy of your files, just in case I missed something!

regards,
-rob.

----------------

---

From: Marino Arturo <[email-masked]>
Date: Sat, 12 Sep 2015 15:52:12 -0700 (PDT)

Hello,

1. Name of the parent folder
2. Month of when the picture was taken
3. Year of when the picture was taken
4. Sequence for all the files starting with 0001

I'm having the following problems:

If I need to use the advance panel how do I do this?

Thank you.