Numbered images to defined date format

Post any Bulk Rename Command support requirements here. Open to all registered users.

Numbered images to defined date format

Postby slips111 » Tue Jul 31, 2018 3:06 pm

I've got 1440 image files numbered consecutively from 0001.jpg to 1440.jpg. I'd like to rename them to a consecutive date format, starting with 08-07-2018.jpg (US format) and going to 07-16-2022.jpg (1440 days later). Is this possible? Thanks in advance for your help.
slips111
 
Posts: 2
Joined: Tue Jul 31, 2018 3:02 pm

Re: Numbered images to defined date format

Postby therube » Tue Jul 31, 2018 5:01 pm

Oh, thinking it should not be an issue for JavaScript.

So if you take 07-16-2022 & convert that to a julian number, 2459777, then simply decrement that number by 1, that will give you your consecutive days. Convert those numbers back to a date format & you're done ;-).

The hard part is in the details (& that is beyond me) ;-).



(Oops. I'd meant to "take" the starting date & increment... but if you take the ending date & decrement, that should work too.)
Last edited by therube on Tue Jul 31, 2018 5:08 pm, edited 1 time in total.
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Numbered images to defined date format

Postby slips111 » Tue Jul 31, 2018 5:08 pm

Thanks for the response. I hadn't thought about the Julian numbers. Smart. Anyone else have any idea of how to actually get this converted to the standard date format?
slips111
 
Posts: 2
Joined: Tue Jul 31, 2018 3:02 pm

Re: Numbered images to defined date format

Postby therube » Tue Jul 31, 2018 5:09 pm

([Paid version of BRU] can do JavaScript.)

Code: Select all

0010 REM "img2jul"   therube 07-31-2018
0020 LET I=2458338; REM 2459777
0030 FOR J=1 TO 1440
0040 CALL "jul2day",STR(I),"2",DT$,"","",""
0050 PRINT I,":   ",DT$
0060 LET I=I+1
0070 NEXT J
0080 END

https://pastebin.com/Y2ym6a1x

Now, JavaScript-ifty it & you're done ;-)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to BRC Support


cron