324567-“Intersec Research and Technology Complex Eye Microsurgery n a Fyodorov Novosibirsk Branch
339733-A.O.U. Policlinico “G.Rodolico - San Marco”; Clinica Neurologica
203215-INTERNAL MEDICINE / DIVISIONHEMATOLOGY/ONCOLOGY
338983-X CEPHO - Centro de Estudos e Pesquisas em Hematologia e Oncologia
used below logic to remove but In case of " abc " string craetion is a problem also in case of " replacing single quote is a problem.
Sitename.Replace(“",” “).Replace(”/“,” “).Replace(”:“,” “).Replace(”*“,” “).Replace(”?“,” “).Replace(”<“,” “).Replace(”>“,” “).Replace(”|“,” “).Replace(”;“,” “).Replace(”'“,” “).Replace(“char(34)”,” “).Replace(”“”“,” ")
neha.upase
(Neha Upase)
December 19, 2023, 8:53am
2
Hi,
you can try below query
Sitename.Replace(“'”, " “).Replace(”/“, " “).Replace(”:”, " “).Replace(”*“, " “).Replace(”?”, " “).Replace(”<“, " “).Replace(”>”, " “).Replace(”|“, " “).Replace(”;”, " “).Replace(”"“, " “).Replace(”""”, " ")
This should handle the single quote issue.
Hi @shashank_dullu ,
You can use following regex to replace special characters.
System.Text.RegularExpressions.Regex.Replace(variable, “[^a-z A-Z 0-9]”, “ ”)
System.Text.RegularExpressions.Regex.Replace(variable, “[^Characters you want keep as it is]”, “replacing character”)
neha.upase:
Sitename.Replace(“'”, " “).Replace(”/“, " “).Replace(”:”, " “).Replace(”*“, " “).Replace(”?”, " “).Replace(”<“, " “).Replace(”>”, " “).Replace(”|“, " “).Replace(”;”, " “).Replace(”““, " “).Replace(””"”, " ")
I have already tried this. Throwing error At single Quote ("). that was the reason of choosing char (34) but the replace function wants string value in it
vrdabberu
(Varunraj Dabberu)
December 19, 2023, 9:02am
5
Hi @shashank_dullu
System.Text.RegularExpressions.Regex.Replace(Sitename.ToString,"([^a-zA-Z0-9\s])"," ")
Regards
Parvathy
(PS Parvathy)
December 19, 2023, 9:04am
6
Hi @shashank_dullu
Try this:
Input: "324567-“Intersec Research and Technology Complex Eye Microsurgery n a Fyodorov Novosibirsk Branch"
output: System.Text.RegularExpressions.Regex.Replace(Input,"[^\d A-Z a-z]","")
Hope it helps!!
Hi @Mohan_Reddy -
I have tried with Regular expression but is replacing lot of other things also because of which the meaning of the sentence is also changing .
only need to remove these special character.–> \ / : * ? " < > | ; ’
Also the Sentence is not getting converted in String properly because of multiple " in it
try this - 346677-X Fundação Pio XII Hospital de Câncer de Barretos
in your logic name is getting changed
Parvathy
(PS Parvathy)
December 19, 2023, 9:18am
9
Hi @shashank_dullu
Try this:
System.Text.RegularExpressions.Regex.Replace(Input,"[^0-9 a-z A-Z À-Ö Ø-ö ø-ÿ]","")
Hope it helps!!
What is this ? How to Place my chacrter in this -
\ / : * ? " < > | ; ’
vrdabberu
(Varunraj Dabberu)
December 19, 2023, 9:25am
11
Hi @shashank_dullu
Please use the below expression in assign activity
System.Text.RegularExpressions.Regex.Replace(Sitename.ToString,"([~`!@#$%^&*()_+-={}|:"<>?\[\]\;',./])"," ")
regards
vrdabberu:
[^a-zA-Z0-9\s]
Hi @shashank_dullu ,
Try the following expression:
System.Text.RegularExpressions.Regex.Replace(variable, “[^a-zA-Z0-9\s-.]”, “ ”)
vrdabberu
(Varunraj Dabberu)
December 19, 2023, 9:30am
14
Hi @shashank_dullu
Try this please
[^0-9 a-z A-Z À-Ö Ø-ö ø-ÿ]
regards
How can we handle the below scenario in the inputs we are getting as we know it is not fixed the input the we are getting based on special charcters
vrdabberu
(Varunraj Dabberu)
December 19, 2023, 10:22am
16
Hi @shashank_dullu
if you are using the above in an assign activity then please store that data in a double quotes as it resembles the string data type.
Regards
While Putting the string into Quotes becuase of " ’ the string is not getting creating because of special characters
vrdabberu
(Varunraj Dabberu)
December 19, 2023, 10:45am
18
Hi @shashank_dullu
Can I know from where you will be getting those data?
Regards
This is the part of input that I will be receiving which is not in any fixed format . that is the overall reason of having this Replace .
324567-“Intersec Research and Technology Complex Eye Microsurgery n a Fyodorov Novosibirsk Branch
339733-A.O.U. Policlinico “G.Rodolico - San Marco”; Clinica Neurologica
203215-INTERNAL 'MEDICINE / DIVISIONHEMATOLOGY/ONCOLOGY
338983-X CEPHO - Centro de Estudos e Pesquisas em Hematologia e Oncologia
vrdabberu
(Varunraj Dabberu)
December 19, 2023, 10:58am
20
Hi @shashank_dullu
So when you are receiving that data you can directly store them in a string variable. So, after storing them in a variable use the regex directly on that variable.
Regards