Subject: Re: [Name Mangler Talk] flipping part of the filename

From: mkwrnck <[email-masked]>
Date: Mon, 22 Mar 2021 14:07:39 -0700 (PDT)

Thanks, Rob. That's much more than I could have come up with; so I'll give 
it a try asap and let you know.

Mike

On Monday, March 22, 2021 at 4:45:54 PM UTC-4 Many Tricks wrote:

> On Mar 22, 2021, at 1:18 PM, mkwrnck <[email-masked]> wrote:
>
> I think I’d like to rename them 20210322 TC.pages, so that when my Mac 
> window sorts by filename, they’re fully in chronological order. Can someone 
> please tell me if Name Mangler can do this, folder by folder, and how? 
> Thanks.
>
>
> This should work, but *please test on a copy of your files*, or a subset 
> that has a backup, in case something goes wrong. It assumes you always used 
> two digits for the month and day, and it will break if you didn't. 
> Screenshot:
>
> Find: ([0-9]{2})([0-9]{2})([0-9]{4})\ (.*)$
> Replace: $3$1$2 $4
>
> The find saves into a group (variable, basically; the parentheses do that) 
> the first two digits into $1, the next two digits into $2, then the year 
> into $3, and then everything after a space to the end of the filename into 
> $4. The Replace is just a matter of reassembling the bits in the right 
> order, and adding the space that wasn't saved.
>
> -rob.
>
>
>

---

From: Rob Griffiths <[email-masked]>
Date: Mon, 22 Mar 2021 13:45:50 -0700

On Mar 22, 2021, at 1:18 PM, mkwrnck <[email-masked]> wrote:

> I think I’d like to rename them 20210322 TC.pages, so that when my Mac window sorts by filename, they’re fully in chronological order. Can someone please tell me if Name Mangler can do this, folder by folder, and how? Thanks.

This should work, but please test on a copy of your files, or a subset that has a backup, in case something goes wrong. It assumes you always used two digits for the month and day, and it will break if you didn't. Screenshot:

The find saves into a group (variable, basically; the parentheses do that) the first two digits into $1, the next two digits into $2, then the year into $3, and then everything after a space to the end of the filename into $4. The Replace is just a matter of reassembling the bits in the right order, and adding the space that wasn't saved.

-rob.

---

From: mkwrnck <[email-masked]>
Date: Mon, 22 Mar 2021 13:18:04 -0700 (PDT)

Hello…

Over the years, I’ve named hundreds of files, sorted in nested folders; for 
example:

03222021 TC.pages

for

month: 03
date:  22
year: 2021

Mike