After Screen scrapping need to extract customer data from the whole text

Hi

After screen scrapping the output is below

Trx Number:30593778 Type:INT_INPOLE_INV_4007 Customer Name:GE MEDICAL SYSTEMS LIMITED Customer Number:250962 Account Description: Location:3501339 Status:Closed Trx Number:30593778 Type:EXT_DOMTX_INV_GEMSIT Customer Name:TRILLAMED LLC Customer Number:1310983 Account Description: Location:3601101 Status:Closed

Need to Extract only Customer Number value
Ex:250962 and 3501339 into List variable

Thanks
Likitha

@vinjam_likitha

Please try this to get all customer numbers as Array

System.Text.RegularExpressions.Regex.Matches(str,"(?<=Customer Number:\s*)\d+").Select(function(x) x.Value).ToArray

cheers

Hi

You can use Regex expression here like this in a assign activity

List_value = System.Text.RegularExpressions.Regex.Matches(str_input.tostring,“(?<=Customer Number:)\s*(.*?)(?=Account Description:)”).Select(function(x) x.Value).ToList()

Cheers @vinjam_likitha

HI @vinjam_likitha

you can try with regex in this way

or else
str_variable=system.Text.RegularExpressions.Regex.Matches(“yourText”,“(?<=Customer Number:\s{0,})[0-9]+”).ToArray

Based on index you can call it or you can try with for each activity to display all the matches

Hi @vinjam_likitha

Check the below regular expressions to extract the Customer number and Location

- Assign -> List<Regex> = System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“((?<=Customer Number:)\d+|(?<=Location:)\d+)”)

Check the below regular expression to extract only customer number.

- Assign -> List<Regex> = System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“((?<=Customer Number:)\d+)”)

Hope it helps!!

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