Hi All,
I am trying to remove special characters in DataTable using regex (Here I dont want $,USD and any space or dot.
I am using following regex expression however getting error
(From r In DT1.AsEnumerable
Select ra = r.ItemArray.Select(Function (x) System.Text.RegularExpressions.Regex.Replace(x,“[^a-zA-Z0-9]”,“”)).ToArray()
Select dtout.Rows.Add(ra)).CopyToDataTable()
mkankatala
(Mahesh Kankatala)
March 7, 2024, 8:23am
2
Hi @marina.dutta
There is a small modification in the code, check the below one,
(From r In DT1.AsEnumerable
Let ra = r.ItemArray.Select(Function (x) System.Text.RegularExpressions.Regex.Replace(x.toString,"[^a-zA-Z0-9]","")).ToArray()
Select dtout.Rows.Add(ra)).CopyToDataTable()
Hope it helps!!
@mkankatala
one more thing. I need to remove the USD from D column also. Can I include in same expression?
mkankatala
(Mahesh Kankatala)
March 7, 2024, 8:38am
4
Could you raise new query for this… @marina.dutta
@mkankatala
Tagged you in the new Query. Can you please help on this two below links ?
Hi,
I want to remove the USD from excel column and format the date to to one format MMDDYYYY . Can I do this in single link query
[image]
Hi,
I have cloned my Data Table and used LINQ Query to remove special characters but now I am getting empty data Table. In immediate panel getting datatable value but when doing output data table and message box its empty
[image]
[image]
[image]
[image]
[image]
system
(system)
Closed
March 10, 2024, 9:04am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.