How access specific data elements execution of Read OCR with Image

Hello
Need to know how perform below action

  1. Have Image pdf of more than 1000+ Pages
  2. Using Google OCR, I am able to read Image PDF and then write content in Excel Cell
  3. Problem is
    I do not want all content of IMAGE PDF,
    Just few specific details which can be present on any page of 1000+ pages

any one please help me to learn, How to read/access/extract specific content from PDF. Once its processed from OCR engine.

Hi @prashant231082,

Welcome to the forum,

lets say the output of the read PDF with OCR activity is str. And you want to take specific details from each page. If the pages are similar and the data you want to get is also similar (eg. Invoice number). Then you can use split on str in the following format.

str.Split({" before_part", “after_part”}, StringSplitOptions.None)

for example, lets say str is “bla invoiceNo1 something…bla invoiceNo2 something”, then to get invoice numbers you can use str.Split({"bla ", “something”}, StringSplitOptions.None) in an assign activity in which variable on the LHS should be array of strings (String[.])

Hope it helps

Regards

Thanks Yogesh, I will try mentioned method and will get back …

Thanks Sir…, It worked.
Now data is extract properly as required and also stored in array of String ( LHS of assign).
Since, LHS is array.String has multiple values, now writing extract values from array in Excel … i am getting value “System.String” in excel cell .

Is there any way to write all Array string values in one shot in one excel cell
OR
I have to Read Array Element One by One and write in excel.

1 Like

Buddy @prashant231082

Thats great…
so yes buddy you can add the array to the excel as one shot like this

  1. create a datatable with build datatable activity and get the output as out_dt
  2. use a add datarow activity with input of the array of string you have and that should be passed to the property Arrayrow in the add datarow property and mention the datatable property with out_dt that we build earlier
  3. now use a write range workbook activity with inputs like file path of the excel, datatable, and the sheetname you want and the range to start with
    thats all buddy you are almost done
    Kindly try this and let know buddy whether this works or not
    to be even better here you go a sample xaml to add array string to a excel
    Test_1.xaml (8.3 KB)

Cheers @prashant231082

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.