Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


BobJ
  •  BobJ
  • Paid support Topic Starter
2014-11-29T16:42:46Z
I am trying to modify a rename task that for the most part works. I want to tag the date and time on the end of the existing file name. My Post process mask is currently defined as: {STRING(Replace|{NEWNAME()}|.|_{DATEFORMAT(yyyyMMdd_HHMMss)}.)}

This process works - most of the time, however, if the original file name contains multiple "." in the file name (i.e. "first.middle.last.pdf", the post process mask forces EACH incidence of "." to change to the date/time string. The length and content of the file name gets completely out of control. I was trying to find a way to apply the date/time string to only the last "." found in the file name.

I found the string function LastIndexOf and it seems that if I could integrate that function into the post process mask, I could apply the date/time string to just the last incidence of ".". I just can't seem to get the syntax right when attempting to concatenate multiple functions in one command.

Could someone provide any insight (or suggest an alternative command?) to solve this problem. Thanks!
Sponsor
Forum information
al355
2014-11-29T18:38:58Z
Just a thought, could you do this as 2 renames to make it easier? I realise this is isn't ideal but we have a similar situation and have dealt with it by having 2 of the same task rather than trying to achieve it in a single one.
bbusse
2014-12-04T22:02:01Z
This should work, assuming the filename always has .pdf at the end of it. Case matters, .PDF is not .pdf, just so you're aware.


{STRING(Replace,{NEWNAME()},.pdf,)}.{DATEFORMAT(yyyyMMdd_HHMMss)}.pdf


it's broken up in 3 parts, but i treat it as a string of text being built one after another.
First i strip off the PDF extension including the . with is to ensure we don't grab the letters pdf randomly in the middle of the filename (still not guaranteed if someone creates a file called important.pdffile.pdf )
{STRING(Replace,{NEWNAME()},.pdf,)}

Then we add a . and the date format you want:
.{DATEFORMAT(yyyyMMdd_HHMMss)}

Then follow it up with a . and pdf to re-apply the file extension.
.pdf

Brian
Scroll to Top