([A-Z].[A-Z]\d+.SFR)|([A-Z].[A-Z][0-9]\d+.SFR)|([A-Z].[A-Z][0-9]\d+[A-Z].SFR)|([A-Z].[A-Z]*[0-9]\d+ -.SFR)
Above expression is my regular expression for matching the multiple pattern of strings.
pdf_sfr This is the variable capturing the “1468 SFR” but it should capture the “Any characters ends with SFR” Example.:- A-12345 SFR, PAC-A0123-SFR.
Whatever it scans at the beginning its picking that, how to change the expression.
What changes I need to do.
Please help me.
Hi @Steven_McKeering ,
This is the sample from excel and stored into output data table. and need to pick.
sfr
1468 SFR PHOTO_9e000
C-Z01468- ONOFF
C-Z01468-ZZZ111
C-Z01400-LLO
C-Z01468-MODULE
C-Z01468-REPAIRED
C-Z01468- PARTS
C-Z01168-SFR
C-Z00068-SAA
C-Z00068-TAAA
C-Z00033-TEST_9c001
1468 - SFR
The names having “Any character ends with SFR” i.e, “*.SFR”. Here its picking
It should pick
Expected output patterns:
A-789654 SFR, A-Q12345-SFR, DDD-BN4455_SFR, WWW 78955_SFR, V 963852-SFR
hi @supermanPunch ,
I am not using matches, Excel data into output Dt and assigning reg expression to pdf_sfr variable.
in msg box filename is displayed and that variable is passed to click activity. Making click as dynamic.
.+SFR$ => this expression also not captured showing blank.
What changes I need to do.
I think it’s better not to use Output Datatable to generate the Datatable as String, as it also includes commas as separators and may also provide some unexpected outputs.
Could you let us know what is the Data that you are using from the Datatable. Could you save the Output from Output Datatable Activity into a text file and send it here, it will be faster to understand what is the actual data and what should be the logic to extract it.
@supermanPunch ,
Data scrapping data will be stored into excel and consists of list of file names. And that excel data is stored into output data table and performing the regex operation.
@THIRU_NANI ,
System.text.RegularExpressions.Regex.Match(InputStringVariable,“.*SFR$”).ToString
I tried but showing blank.
System.Text.RegularExpressions.RegEx.Match(Sfr_dt,“.*SFR$”).ToString
Not extracting. In excel and text file data is writing but not extracting.
@THIRU_NANI ,
System.Text.RegularExpressions.RegEx.Match(Sfr_dt,“([A-Z].[A-Z]\d+.SFR)|([A-Z].[A-Z][0-9]\d+.SFR)|([A-Z].[A-Z][0-9]\d+[A-Z].SFR)|([A-Z].[A-Z]*[0-9]\d+ -.SFR)”).ToString
Now data extracted with my old expression, which i mentioned at beginning.
It worked.
Thanks,
Lakshmi