How to extract the amount from string

Based on a complete visual inspection of the interior and exterior areas of the subject property, defined scope of work, statement of assumptions and limiting

conditions, and appraiser’s certification, my (our) opinion of the market value, as defined, of the real property that is the subject of this reportis

350,000

as of 11/18/2021

which is the date of inspection and the effective date of this appraisal.

50,000

From the above string I need to extract only the amount using regex how can we do it.

Hi @varun_sai

Try out this regex ((?<=$)[\d,]+)

Update us whether you got solution or not

Thanks,
Robinnavinraj S
image

image
It’s not working for me and the amount we need to extract will be 350,000 please ignore the “$”

Try out this
([\d,]+)

It worked but in the whole string it’s picking up the “,” at index(0) can we get the number at index 0

I want to know whether the amount value is static or dynamic

Hi,

Try like below. Thanks.

Resultmatch = System.Text.RegularExpressions.Matches(inputstring,“([0-9]+)”)

Use Resultmatch(0).tostring

image
Thankyou for the help

Can you try this regex
([\d,]+)(?=\n)

image
It’s separating the number between “,”

Hi,

I think below will work. Pls check

([\d,]*)

You could use matches activity and first index. Thanks.

image
Actually I am reading a PDF with OCR after reading the PDF I am getting the out put in different format each time as you can see above some times $ will come infront of Amount and sometimes"," comes at last and some times “[space]”

If you can help me figure this out I am grateful.

Can you share us extracted text files so that only we could give a solution as you expected

Hi @varun_sai

Try this regex
(((?<=\$)[\d,]+)|([\d,]+)(?=\n))
image

Thanks,
Robin S

TEST.txt (1.5 KB)

TEXT1 and TEXT2 and TEXT3 and TEXT 4 are extracted from 4 different reports

It’s working Thankyou so much!

Thankyou for the help!

Or You try this expression also

([\d,]+)(?=[\s\n]+as)

it will exactly extract all amount for all different extractions


image

Thanks,
Robin S

your welcome

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