Extract invoice details by screen scrapping method

Hello all.
I am trying to extract invoice details by screen scrapping method.
Below is the format

Invoice ID: 640419
Date: 2017-06-18

Vendor: Clipboard Papers

Address: Strada Agrafei 67

Tax ID: RO657483
City: Brasov,
Country: Romania

Item # Item Description Unit Price Units Total
1 Concierge Services 187124 RON 1 187124 RON

Subtotal: 187124 RON
Tax: 37424.8 RON
Total: 224549 RON

Now how to extract the scrapped data ( like Invoice no, Date, Invoice ID, Subtotal ,… etc.).

Thank you.

Hi,

We can get each item using regex as the following, for example.

System.Text.RegularExpressions.Regex.Match(result,"(?<=Invoice ID:\s*).*").Value

If you want to get Subtotal, regex pattern will be "(?<=Subtotal:\s*).*"

Sequence.xaml (5.2 KB)

Regards,

1 Like

Thanks for the solution Yoichi :smiley:
Sorry for the trouble. I have one more question.
How check if Invoice ID exists in scrapped data( True or False).

1 Like

Hi,

If there isn’t “Invoice ID:” in the text, the above expression returns “”. So we can check it using If activity.

or we can also use the following expression.

System.Text.RegularExpressions.Regex.IsMatch(result,"Invoice ID:")

This returns True/False.

Regards,

1 Like

Thank you.
It worked!! :smiley:

1 Like

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