Batch rename files to their file dates and times?

Ideas for improvements and requests for new features in XnView Classic

Moderators: helmut, XnTriq, xnview

Post Reply
ghost zero
Posts: 358
Joined: Mon Feb 05, 2007 8:26 pm

Batch rename files to their file dates and times?

Post by ghost zero »

Is there a way to batch rename files to their file dates and times? Such as:

"[modified date time]" = 2007/08/04 12h-38m-23s.jpg
Last edited by ghost zero on Sat Aug 18, 2007 1:32 am, edited 1 time in total.
User avatar
xnview
Author of XnView
Posts: 46255
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Batch rename files to their file dates and times?

Post by xnview »

ghost zero wrote:Is there a way to batch rename files to their file dates and times? Such as:

cat.jpg > 2007/08/04 12:38.jpg
You can use something like "<Accessed Date [Y/M/d H:M]>"
Pierre.
ghost zero
Posts: 358
Joined: Mon Feb 05, 2007 8:26 pm

Post by ghost zero »

anyway to make it like:

2007/08/04 12h.38m.23s.jpg

i tried using a lowercase s and it turns into an 08...
User avatar
helmut
Posts: 8704
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Post by helmut »

ghost zero wrote:anyway to make it like:

2007/08/04 12h.38m.23s.jpg

i tried using a lowercase s and it turns into an 08...
This filename template roughly does the job:
<Accessed Date [Y/m/d H]>h.<Accessed Date [M]>m.<Accessed Date >s

It's a bit complicated, but not too bad, I think. For some reason I don't understand (at the moment) the slashes are converted to minus chars, output is for example "2007-08-04 12h.38m.23s.jpg".

With "Replace Char" you can change the minus char to slash and get exactly what you want. But I think there should be a way in the template to get the slash... Does anyone have an explanation for the slashes?
User avatar
helmut
Posts: 8704
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Batch rename files to their file dates and times?

Post by helmut »

xnview wrote:You can use something like "<Accessed Date [Y/M/d H:M]>"
Supposed to be "<Accessed Date [Y/m/d H:M]>" (with lowercase "m" for month).
ghost zero
Posts: 358
Joined: Mon Feb 05, 2007 8:26 pm

Post by ghost zero »

...
Last edited by ghost zero on Sat Aug 18, 2007 1:32 am, edited 1 time in total.
User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Post by JohnFredC »

For some reason I don't understand (at the moment) the slashes are converted to minus chars, output is for example "2007-08-04 12h.38m.23s.jpg"
Isn't a slash in a file name verboten in FAT32 and NTFS? My systems certainly won't accept it.
John
Dreamer
XnThusiast
Posts: 4608
Joined: Sun Jul 25, 2004 9:08 pm

Post by Dreamer »

Yes it is, also these \ | / < > : ? and perhaps more.
Dreamer
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France
Contact:

Instead…

Post by Clo »

:) Hello !

• As a workaround, when I need a separator in a file-name I use often the character ¦ (Alt+0166) which is allowed. ;)

- Also when there is an alternative in the spelling, i.e. : “S¦he is…”, that shortens the strings.

:mrgreen: KR
Claude
Clo
Old user ON SELECTIVE STRIKE till further notice
User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Post by JohnFredC »

I like · (alt+183) or (alt+149), though lately I have also been using periods:

For instance:

CAP·DM·V1.070809.exe

Naturally these characters don't work with all display fonts. Not an issue for me, though.
John
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France
Contact:

Also---

Post by Clo »

:) I use them too, and no font problem for me as well, I have put the MS Sans Serif “in the dust bin” !

:mrgreen: KR
Claude
Clo
Old user ON SELECTIVE STRIKE till further notice
User avatar
helmut
Posts: 8704
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Post by helmut »

JohnFredC wrote:
For some reason I don't understand (at the moment) the slashes are converted to minus chars, output is for example "2007-08-04 12h.38m.23s.jpg"
Isn't a slash in a file name verboten in FAT32 and NTFS? My systems certainly won't accept it.
Oops, correct. Filenames must not contain these characters.
ghost zero
Posts: 358
Joined: Mon Feb 05, 2007 8:26 pm

Post by ghost zero »

how about adding a new code to simplify this and prevent errors? such as:

"[modified date time]" = 2007/08/04 12h-38m-23s.jpg

year, month, date, h m s ... renamed in such a way that the date/time alphabetizes correctly
Post Reply