You are viewing limited content. For full access, please sign in.

Question

Question

two date types - rename files

asked on May 13, 2016 Show version history

When our company implemented LF we had to do a large data dump of previous files. At that time the naming convention was: FileName 3105552_CF088_April 2015. I inherited this system but at some point the files are now being named: FileName 3133499_CF885_2015-04-09. I have been tasked with moving the date to the earlier in the naming convention. I have written a workflow to do this so the result is: FileName 2015-04-09_3133880_CF077. Unfortunately with the Dates spelled out the pattern match fails and results as: FileName 2015. Any idea how I can change the named dates to proper dates without a lot of manual work? I realize the default day will become 01 since there is not a day listed but the product owner is fine with that.

0 0

Replies

replied on May 13, 2016

Should be do-able. I broke it down into 2 workflows for efficiency reasons. The first one has a list of months and figures out which month is which numbers. Then for each month, it starts a secondary workflow.

Note that the months are in order in the "Months" token, so the iteration number in For each value corresponds to the month as a number ("1" for "January", "2" for "February", etc). The month as both its name and the number get passed into the second workflow as input parameters.

This second workflow searches for all documents with names containing the given month name. You will most likely have to tweak the search criteria there to narrow down your results as needed.

Then for each search result, it runs pattern matching to get the other date parts and then combines them back to rename the document. Since we already know the month number because it was sent in from the first workflow, we can just use the input parameter's token in the document name. I formatted it as D2 so it would get a leading zero for months 1-9.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.