Hi all ,
Im reading an excel and for each row i need to use regex and get only alphabets, special characters and digits for each row accordingly. But for special characters and digits and im getting an empty value while displaying the result.
The properties here in replace matching activity im little confused.
Main.xaml (15.5 KB)
Can you pls check and help where i went wrong
Parvathy
(PS Parvathy)
October 11, 2023, 3:32pm
2
Hi @parvathi_ayanala
Can you please share excel with dummy data so that we can help you with solution. Please specify your requirement.
Regards,
supriya117
(Supriya Allada)
October 11, 2023, 3:36pm
4
Hi @parvathi_ayanala
An error has been identified digits block
alpphabets = "[^a-zA-Z]"
digits = "[^0-9]"
specialChars = "[a-zA-Z0-9]"
Parvathy
(PS Parvathy)
October 11, 2023, 3:46pm
5
Hi @parvathi_ayanala
In Replace Matching Patterns activity you have given the
Text to Replace as CurrentRow(1).ToString for index=1
Text to Replace as CurrentRow(2).ToString for index=3
You need to pass CurrentRow(0).ToString in all three matching patterns.
Regex Expressions are:
alphabet="[^a-zA-Z]"
specialchar= "[a-zA-Z0-9]+"
Digit= "[a-z]+"
Refer the below Image for Better understanding
Sequence7.xaml (15.8 KB)
Hope it helps!!
Thanks @Parvathy will try and update
1 Like
@Parvathy can you share the xaml. I only want to the in the regex pattern activity the properties “replace text” what should be used. I
replace text: “”
Text to replace: “Current row”
Parvathy
(PS Parvathy)
October 11, 2023, 4:01pm
8
I have shred it above @parvathi_ayanala
Sequence7.xaml (15.8 KB)
Regards,
1 Like
supriya117
(Supriya Allada)
October 11, 2023, 4:04pm
9
@parvathi_ayanala
Simply use assign activity:
For each row in datatable:
alphabets = System.Text.RegularExpressions.Regex.Replace(rowValue, "[^a-zA-Z]", "")
digits = System.Text.RegularExpressions.Regex.Replace(rowValue, "[^0-9]", "")
specialChars = System.Text.RegularExpressions.Regex.Replace(rowValue, "[a-zA-Z0-9]", "")
Hope it helps.
1 Like
system
(system)
Closed
October 18, 2023, 12:22pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.