Get value from output string

I want to get value from the output string extracted from extract pdf.

I just want the value 14308

Rest others I don’t want

Thankyou.

Hi @BHUSHAN_NAGAONKAR1

Input = "m m m m m m m $14,308 00"

Output = System.Text.RegularExpressions.Regex.Match(input,"\d+\,\d+").Value.Replace(",","").Trim
1 Like

@BHUSHAN_NAGAONKAR1,

Try this one.

System.Text.RegularExpressions.Regex.Match(yourString, "(?<=\$)\d+\s*").Value

Thanks,
Ashok :slight_smile:

1 Like

Input is very big since its from pdf, the given is just a minor part.

Thanks

I will try and update

Thanks

Hi @BHUSHAN_NAGAONKAR1

Whatever the data might be the regex provided above will work.

Regards

1 Like

Actually it is not working. It worked for the first but not working for second pdf. The value is blank

Hi @BHUSHAN_NAGAONKAR1

Hi @BHUSHAN_NAGAONKAR1

Please try below

Input = "m m m m m m m $14,308 00"

Output = System.Text.RegularExpressions.Regex.Match(input,"\d+[.,]?\d*[.,]\d+").Value.Replace(".","").Replace(",","").Trim
1 Like

For context I want that specific value in the pdf.

The value is already stored in a variable and it should check if the value is present.

For eg
var = 14031

It should search var, in pdf remove all the extra data, (“,”, “.00”, “$”)

Apologies if there was any confusion in my statement.

Hi @BHUSHAN_NAGAONKAR1

Please follow the above steps and you can acheive the output from the PDF which contains the value and later please use the if condition and give the syntax as

var.trim.equals(output.trim)

If those matches then place the further steps in then sequence and if those doesn’t match then place that relevant steps in else sequence.

Regards

I have used this can you please verify if this correct

Variable: extractedNumber
Value: 

System.Text.RegularExpressions.Regex.Match(yourStringVariable, “\b” + numberToMatch + “\b”).Value.Replace(“,”, “”).Replace(“.00”, “”)

Please check with the above process. Here in the process used by you will not give the exact output as you required.

Regards

Ok, will check and update you.

Thanks

1 Like

Hi @vrdabberu Thanks for your time, its working

Hi @BHUSHAN_NAGAONKAR1

You’re Welcome.

Happy Automation!!

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