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

Question

Question

Splitting a value into multiple values

asked on November 2, 2017

Good afternoon all,

 

I'm using OmniPage Zone OCR to extract the value of a boxed zone. The resulting output is something like 01234567

Now I need to do this 01/23/4567 so I was thinking that maybe if I split the value into 0 1 2 3 4 5 6 7  then I could rejoin them as 01/23/4567 

There might be a better way of course. Any suggestions?

Thank you,

Raul Gonzalez

0 0

Answer

SELECTED ANSWER
replied on November 2, 2017

Hi Raul,

You can just use the token editor to format your Zone OCR output.

3 0

Replies

replied on November 2, 2017

Hi Raul,

I think you're on the right path. Use pattern matching to generate 3 tokens--let's call them "Month", "Day", and "Year". The patterns for extracting them from your example string are:

  • Month: ^(\d{2})
  • Day: \d{2}(\d{2})
  • Year: (\d{4})$

 

Then you'll create a token, let's call it "Date", like so:

  • Date: %(Month)/%(Day)/%(Year)
     

Apply the %(Date) token where appropriate.

~Rob

1 0
replied on November 2, 2017

Thank you, I'm trying both.

Tri Pham, in your example. I'm using it the way you are and it does give me the desired results in the test, just like in your example. However, when I run a "Test process" I only get the numbers. However, I noticed that the numbers in the result are something like 0 1 2 34567. Do you think it's because of the spaces in between?

I run a static test using a token with a value of 01234567 and it worked so I'm guessing that it is due to the spaces in between. How can I resolve that? I'm looking into different tutorials right now.

the 0 1 2 3 4567 comes from an OminPage Zone OCR Token

 

Thank you,

 

Raul

0 0
replied on November 2, 2017 Show version history

Hi Raul,

Yes you'll want to remove the spaces. You can use either pattern matching or substitution. See here.

Pattern Matching: Return all matches (combined with no space). Use this pattern - [^ ]+

Substitution: Replace " " (a space) with "" (null).

 

2 0
replied on November 2, 2017

Thanks Tri Pham, took me a while to figure out what you meant by "Substitution". I didn't know it was a tool. Finally found it and worked a little with it with expected results.

Rob Mccluskey, thanks for the alternate solution.

Thank you both,

Raul Gonzalez

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

Sign in to reply to this post.