Page 1 of 1

Changing date and time format in filename

PostPosted: Sun Feb 07, 2021 9:52 am
by chrisbunch
I am trying to convert filenames in the format "Scan 30 Jan 2021 at 17.34.pdf" to "Scan 2021-01-30 17.34.pdf"

I can automatically extract the date into a custom date attribute but how do I do likewise for the time? I have tried to extract the time (nn.nn) into a custom text attribute to using the pattern 11.11 but it doesn't match. See screenshots at http://chrisbunch.uk/docs/S4.png and http://chrisbunch.uk/docs/S5.png.

Is this possible? It's a piece of cake with regex (apart from the month) but I gather regex is not available.

Chris

Re: Changing date and time format in filename

PostPosted: Mon Feb 08, 2021 11:13 am
by Mr_Noodle
Your pattern has to account for all characters in the name, not just the ones you happen to care about. Also, why not grab the whole thing into the date?

Re: Changing date and time format in filename

PostPosted: Tue Feb 09, 2021 10:02 am
by chrisbunch
Thanks Mr N -

I don't get what you mean by 'grab the whole thing into the date'

I am trying to convert filenames in the format 'Scan 25 Aug 2020 at 07.52.pdf' to format 'Scan 2020-08-25 at 07.52.pdf'

A condition 'Name matches' a custom token in the format Image doesn't match.

Even if it did match I'm not clear how to rename it in the action. Is this a task that needs a script? (I have done one in Python)

Re: Changing date and time format in filename

PostPosted: Tue Feb 09, 2021 11:23 am
by Mr_Noodle
Name does not include the extension so you need to leave that off the pattern. In your rename pattern, whatever custom date attribute you create will be available to drag in. Drag it in and then click on it to reveal a menu. From there you can edit the date format. You can then specify the date format however you want.

Re: Changing date and time format in filename

PostPosted: Tue Feb 09, 2021 2:17 pm
by chrisbunch
That has cracked it - thank you again.

Chris
________________________