Extract data1

Hi all,

I have extra a particular data from a table. I have done screen scraping so i am getting the output from that.

The output looks something like this
Name: XYZ
A/C Date: 12-06-2022
Opening Bal.GBP 654,657.05
Closing Bal.GBP. 765,765.89
Balance. 654,76.90

From the above I want the amount which is Closing Bal.GBP that is I want to extract 765,765.89 .

How should I do this

You can try with regex

@hanviprebday

1 Like

Hi @hanviprebday

Try this

(?<=Closing\s+Bal.GBP.\s+).*

you can try this regex expression

System.Text.RegularExpressions.Regex.Match(input,"(?<=Closing Bal.GBP.)\s{0,}[0-9,.]+").Value.Trim

@hanviprebday

Try this

(?<=Closing Bal.GBP.\s).*

@hanviprebday

str=Name: XYZ
A/C Date: 12-06-2022
Opening Bal.GBP 654,657.05
Closing Bal.GBP. 765,765.89
Balance. 654,76.90

System.Text.RegularExpressions.Regex.Match(str,"(?<=Closing.Bal.GBP.\s)\s*([\d,]+\.\d{2})").Value

image

or

System.Text.RegularExpressions.Regex.Match(str,"(?<=Closing Bal.GBP.\s)\s*([\d,]+.[\d,]+)").Value

image

cheers…!

1 Like

@hanviprebday

Use this Simple Regex.

image

1 Like

Thank you all it’s working

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