Sequential Dates Using Last Day(or First Day) of the Month

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Sequential Dates Using Last Day(or First Day) of the Month

Postby VtheMech » Thu Apr 13, 2017 5:18 pm

I have bank statements that need the last day of the month at the end in "MM-DD-YYYY" format.

Statement 11-30-2014
Statement 12-31-2014
Statement 01-31-2015
etc

Can this be easily done?

And while I'm making a thread here, sometimes I need the date to be at the first of the month.

Statement 01-01-2014
Statement 02-01-2014
etc
VtheMech
 
Posts: 3
Joined: Thu Sep 22, 2016 4:17 pm

Re: Sequential Dates Using Last Day(or First Day) of the Month

Postby therube » Fri Apr 14, 2017 1:34 am

Is the word, Statement, literal, as in "Statement"?

I take it existing files are named "Statement YYYY-mo-da"?
mo & da are 2-digits, year is 4?


1:RegEx
Code: Select all
Match:  (.* )?(\d\d-\d\d)-(.*)
Replace:  \1 \3-\2


Kind of ugly, but might do the trick.

Ignore that. I though you were wanting to go from YYYY-mo-da to mo-da-YYYY, but that is not what you want at all.



Likewise:


1:RegEx
Code: Select all
Match:  (.* )?(\d\d)-\d\d-(.*)
Replace:  \1\2-01-\3
Last edited by therube on Fri Apr 14, 2017 1:54 am, edited 2 times in total.
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Sequential Dates Using Last Day(or First Day) of the Month

Postby Admin » Fri Apr 14, 2017 1:39 am

Also is the "month" info to be taken from the date that is in the file name or from the timestamp of the file in Windows? thanks
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm

Re: Sequential Dates Using Last Day(or First Day) of the Month

Postby therube » Fri Apr 14, 2017 1:45 am

Oh, you want something like...

Code: Select all
da: > ##
01 -> 31
02 -> 28 (or 29 ;-))
03 -> 31
04 -> 30
...
12 -> 31


I didn't read it that way, at first.
Hmm?

I'd think that to be a job for JavaScript.



(Oh, I totally misread what you were wanting.
The subject line definitely needs to be read in conjunction with the rest of the post.)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to Javascript Renaming


cron