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

Question

Question

Need help with Token expression

asked on March 29, 2016

Hello,

I was wondering if someone could shed some light on the following token expression I am working on.  I would like to import files into Laserfiche and based some of the metadata fields on the file name structure.

The file looks like this.

999999,Group,First Name, Last Name

I have the following expression for the 999999   [^ _ ]* and it works fine but I need help to figure our the expression to pull the "Group" into metadata as well and the First and Last name.

 

Any assistance would be greatly appreciated.

 

Jennifer

0 0

Replies

replied on March 29, 2016 Show version history

For pattern matching is everything always just going to be between the commas?  Could a comma be part of the data?

You could simply create a token for each section.  Number, Group, First, and Last.

Your pattern would be:

Number - (\d*)\,.*

Group - \d*\,(.*)\,.*

First - \d*\,.*\,(.*)\,

Last - \d*\,.*\,.*\,(.*)

Each of those should give you the section of the name you want.

You may need to throw in some whitespace characters to accommodate the spaces after the comma.  Or if you are generating this file take the spaces out and just have the data with comma separators. 

 

2 0
replied on March 29, 2016

This is just a different approach to the same thing without using pattern matching. I'm making the same assumption here as Chris, that there are no commas which are actually part of the data.

I would simply use a Split function on the Entry ID to create a multi-valued token with data.

Then it's just a matter of setting the metadata you want to the corresponding index of the multi-value token.

For example,

This would return the 2nd value of the multi-value token, in this case, being the Group.

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

Sign in to reply to this post.