Subject: Re: [Name Mangler Talk] Question on dates

From: Kevin Mueller <[email-masked]>
Date: Sun, 27 Jul 2014 09:44:10 -0700 (PDT)

Thanks for the solution as it help me too!

On Monday, April 15, 2013 11:31:56 AM UTC-4, Many Tricks wrote:
>
> On Apr 15, 2013, at 1:40 AM, drumbo <[email-masked] <javascript:>> 
> wrote: 
>
> > Was wondering if someone may be able to help me: I currently have a lot 
> of 
> > files that have been named as DDMMYYYY - * (* being the rest of the 
> name). 
> > What I would like to do is to reformat the date now to be like YYYYMMDD 
> - 
> > *. Is this possible? 
>
> Sure, as long as the files are always in that format (i.e. no single-digit 
> days or months). Set Name Mangler to Find and Replace, and check the "Query 
> is a regular expression" box. In the find box, enter this: 
>
> (\d{2})(\d{2})(\d{4})(.*) 
>
> In the "Replace with" box, enter: 
>
> $3$1$2$4 
>
> The way this works is that anything in (parentheses) is treated as a 
> variable, and variables are denoted with a $ followed by a digit, from 1 to 
> however many you create. So the "find" bit works out like this: 
>
> (\d{2}) - The first two digits (month) are assigned to $1 
> (\d{2}) - The next two digits (day) are assigned to $2 
> (\d{4}) - The next four digits (year) are assigned to $3 
> (.*) - Everything else is assigned to $4 
>
> Then the replace is simply a matter of putting the variables in the order 
> in which you want them. 
>
> *** PLEASE TEST ON A COPY OF YOUR FILES BEFORE COMMITTING THIS TO REGULAR 
> USE! *** 
>
> regards, 
> -rob.

---

From: drumbo <[email-masked]>
Date: Mon, 22 Apr 2013 04:16:52 -0700 (PDT)

Super duper - thanks a mil Rob - worked a treat

---

From: Rob Griffiths <[email-masked]>
Date: Mon, 15 Apr 2013 08:31:56 -0700

On Apr 15, 2013, at 1:40 AM, drumbo <[email-masked]> wrote:

> Was wondering if someone may be able to help me: I currently have a lot of 
> files that have been named as DDMMYYYY - * (* being the rest of the name). 
> What I would like to do is to reformat the date now to be like YYYYMMDD - 
> *. Is this possible?

Sure, as long as the files are always in that format (i.e. no single-digit days or months). Set Name Mangler to Find and Replace, and check the "Query is a regular expression" box. In the find box, enter this:

$3$1$2$4

The way this works is that anything in (parentheses) is treated as a variable, and variables are denoted with a $ followed by a digit, from 1 to however many you create. So the "find" bit works out like this:

Then the replace is simply a matter of putting the variables in the order in which you want them.

*** PLEASE TEST ON A COPY OF YOUR FILES BEFORE COMMITTING THIS TO REGULAR USE! ***

regards,
-rob.