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

Question

Question

Searching paragraph marks in fields

asked on January 14, 2015

Hello Everybody,

 

I have a specific need and would appreciate any help on that.

My case refers to template field values including a Paragraph Mark (^p).

For instance, in a field called “Country”:

Instead of the value written in one line as

“United States”

 

The user input it in 2 lines, like

“United

States”

I need to find all those cases in order to correct them.

I tried many options in the search pane, but none of them gave the right result.

{[]:[Country]=”*^p*”}

{[]:[Country]=”*\n*”}

Etc

 

Does anyone know/imagine a way to get it?

I would really appreciate any help/hint.

 

Thanks and best regards,

 

Ignacio PdeA

BMB sal

 

0 0

Replies

replied on January 14, 2015 Show version history

Without looking at the actual field value itself my guess is that the character(s) that you need to search for are the ASCII 10 (Linefeed) or the ASCII 13 (carriage return), or a combination of both of them. 

I would try a Workflow Search activity that contained a regex evaluation of the [Country] field.  Try a regex using '\r\n' to see if you get any hits.

You could also do the search in a workflow script activity, searching for a field value that contains those ASCII characters and replacing them with a space.  If you want to go in that direction then I can provide some code snippets if you can provide the Laserfiche version you are working with.

0 0
replied on January 14, 2015

So I tried a few things too and using search I couldn't come up with anything. 

I set a document to have (12 space 3)    and one to have (12 return space 3)

 

I can't search of course, just like you. But here's where it get's interesting: I can't pull that out in workflow either!!!

 

It appears that when I pull the metadata from the field I can't act on it either. I tried this as a pattern match: 12.\s3 and I tried 12[\n\r\t\v\f]\s3   --- neither of them match.

 

but If I do 12\s3 it does match.

 

 

The best I could suggest is run a workflow that replaces all "United States" (on the search) with "United States" that you've typed in yourself (and you know it's good). 

 

 

0 0
replied on January 14, 2015

Cliff Primmer is probably on the right track.  Might need to reverse the \r\n and try \n\r.

0 0
replied on January 14, 2015

hrmm... When I was trying to pattern match it in Workflow after retrieving the field I also tried just putting in a "."

 

The pattern I put in the field was 12[return][space]3   -- I also did a 12[shift-return][space]3 in one of them.

When I patterned matched 12.3 or 12\s3 it worked. If I did 12.\s3 or 12[\n\r]\s3 it didn't - as you can see from my post above I tried a bunch of things. I suspect it's not even being brought forward by the retrieve fields function.

I am wondering if Cliff is on to something - I wonder if you retrieved the field via the SDK if you would return the data.  

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

Sign in to reply to this post.