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

Question

Question

Workflow - Apply Format to Date ddMMyyyy

asked on November 10, 2015 Show version history

Hi,

 

I have extracted date text from a document that comes as 25 September 2015. I have in "rename entry" applied the following format: ddMMyyyy that converts the text into 25092015. Based on the clients naming convention they would like the date to be read like: 20150925. Is there a way to switch the date around in the apply format section? Without using pattern matching, maybe I can use a token editor?

 

 

Thanks,

0 0

Replies

replied on November 10, 2015 Show version history

In the 'Rename Entry' activity when you capture the long date value you can format it using 'yyyyMMdd' instead of 'ddMMyyyy'.  Here is a screenshot;

1 0
replied on November 10, 2015

yyyMMdd <-- in the apply formatting box will give you 20150925

1 0
replied on November 10, 2015 Show version history

From what I can tell, your problem is that it is no longer looking at the input as a date after altering it with regex. So the date formatting no longer works. 

1 0
replied on November 10, 2015 Show version history

I was able to do it in a slightly more annoying way, but it works. I created three tokens separating the input into Day Month Year then combined them in the format needed in the fourth token.

1 0
replied on November 10, 2015

Thank you Cliff and Darrell. I did try this initially but it did not seem to work and that is why I posted this question. Strange I think my LF just needed a restart. I have another one that I would like your assistance with the same sort of question however the "Test Value" now is 30/09/2015 it should be returned as 20150930 as per the clients naming conventions. To remove the "/" I used regular expressions (See screenshot below) then I need to get it correct as per the naming convention. It does not work, Does regular expressions supersede the "Apply Formatting"? Any ideas on this one?

 

Thank you so much for you help.

 

Rob

0 0
replied on November 10, 2015

Once you remove the slashes, neither date formatting nor the regular expression will work anymore: formatting because the value is no longer a date and regular expression because it expects slashes in the value and they're no longer there. Additionally, your regular expression is an in-line regular expression so it would not swap the order, just extract the matches.

Operations in the Token Editor are applied in the following order: function, index, formatting, regular expression.

Just use date formatting by itself like Darrell and Cliff suggested above. It's the best choice since it does not rely on the input dates to be in a specific format.

1 0
replied on November 16, 2015

Thank you all for the feedback on this case. I did something very similar to you Darrell. I ran two pattern matches. One to retrieve the date pattern from the text and the second to extract the pattern of the date and split it up. See below:

Pattern Match (1)

Pattern Match (2)

Then I used the extracted dates to rename the entry into the right naming convention. See below:


 Thanks for the ideas and advice.

 

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

Sign in to reply to this post.