Hi,
I have the data where the Pattern will repeat but values will change. I am trying to extract this data using Regex but not able to capture the repeating pattern.
Currently there are only 2 records but it might occur multiple times. I need to extract Company Name & Company ID and the data present in the next line under Death Notifications. Kindly help me to resolve this.
Death Notification(DNE) Post Date: 11-17-2022
Page: 2 of 12
Tr Cd Account Number Name Trace Nbr SSN Date of Death Amount Corrected Information
CompanyName: ABC DEF GHI CompanyId:******1234 SecCode:DNE PostDate:11-16-2022 DescData:
23 12345678901 XYZ WGT S 09876543210 *- -1234 11-10-22 2106.00
CompanyName: JKL DEF GHI CompanyId:******5678 SecCode:DNE PostDate:11-16-2022 DescData:
24 09785643210 HGT BHU 12345678901 *- -1230 11-10-22 2106.00
Hi,
What values are you trying to extract here?
Anil_G
(Anil Gorthi)
December 6, 2022, 8:30am
3
Hi @sneha_arbole1
For Company Name use this
(?<=CompanyName:).*(?=CompanyId:)
For Company ID use this
(?<=CompanyId:).*(?=SecCode:)
And for getting next line of death notification use the below expression and then use a split activity to get the second line after split
(?<=Death Notification).*\n.*
Once you get the match say its stored in a match variable x then x.Trim.Split({Environment.Newline},StringSplitOptions.None)(1)
If you have any questions please let me know
cheers
Gokul001
(Gokul Balaji)
December 6, 2022, 8:36am
4
Hi @sneha_arbole1
How about this expression
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=CompanyName:\s)\S.*(?=CompanyId)").Tostring
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=CompanyId:).*(?=SecCode)").Tostring
Regards
Gokul
Gokul001
(Gokul Balaji)
December 6, 2022, 8:41am
5
Hi @sneha_arbole1
Check out the XAML file
MatchesRegex1.xaml (14.4 KB)
Regards
Gokul
We can get Company name & Company ID under other sections as well. We need to get these data restricted to the Death Notification
I am trying to extract Company Name & Company Id & line below it under Death Notification
Anil_G
(Anil Gorthi)
December 6, 2022, 9:15am
8
Hi @sneha_arbole1
Can you show where else it can come and will it come in same order?
Under death notification how many lines are valid to check the comapny id or name?
cheers
There will sections like Returns where i will get Company Name &ID in same order.
Anil_G
(Anil Gorthi)
December 6, 2022, 9:24am
10
HI @sneha_arbole1
Then first use a regex to identify the data between death notification and returns using the following
(?<=Death Notification)(.|\s)*(?=Returns)
then from output using the above regular expressions already provided you can extract the company name and id
Hope this helps.Let me know if this does not solve
cheers