cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Create Metadata from Filename

Hi everyone

I have a workflow which creates metadata from the filename.  This is mostly simple just using Build String and counting characters.  I have a challenge though when trying to extract a customer name from the file name, for example: "Invoice 11111117 for Order 1011111 for Customer ACME International  Flavours Ltd.pdf" - this is due to customer names obviously not all being the same length so I cannot just count characters like I would to get the Invoice Number or Order Number as these are always fixed lengths at the same place in the file name.

Is there a way to get the customer name out, even though the character counts would be different for almost every file name?

0 Kudos
Reply
2 Replies
Workflow Hero

Re: Create Metadata from Filename

Hi,

if I've understood correctly, the first part (from Invoice to "for") has always the same length, in that case you can use an inline function to remove all the first character (the function ask as parameter the index of first char to be removed (0 in your case) and the number of character to be removed, and it will returns the remaining part of the string

Giacomo

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Create Metadata from Filename

use regular expression and you're not restricted with any part being of fixed or varying length

one like this should work

(?<=for Customer ).*(?=\.\w{3}$)

0 Kudos
Accept as Solution Reply