Hi everyone,
I have a big excel file in which I need to filter the rows if it conatins a particular value. For Eg.-
In below image I need to remove all the rows having math in sub. column.
Hi everyone,
I have a big excel file in which I need to filter the rows if it conatins a particular value. For Eg.-
In below image I need to remove all the rows having math in sub. column.
Anyone, Please it’s urgent…
Try this and do let me know if it’s works -
(From d In DT1.AsEnumerable
Where d("sub").ToString.Trim.Equals("math")
Select d).CopyToDataTable
having math could be interpretated as columnvalue.equals(“math”) or ColumnValue.Contains(“math”)
Based on @indrajit.shah well formulated statement you can do
(From d In DT1.AsEnumerable
Where Not d("sub").ToString.Trim.ToUpper.XXX("MATH")
Select d).CopyToDataTable
XXX = contains or equals
It does filter out / remove all rows containing/equals “math”
Hi @indrajit.shah
If I am not wrong, this looks like an SQL query how can I use it in UIPATH. and I want to delete the complete rows which have “MATH” in the “sub” column, trim will just remove math I guess.
I was thinking of looping all the rows and using regex match and delete those rows, it may take time but will do the job, so for this I tried “MATH$” in match regex, but it deleted all the rows.
Secondly, I was thinking that any better activity if you know please suggest to me
@Krishna_Sanghi
it LINQ not SQL
have a look here:
it can be used within an assign statement:
left side: yourResultDataTableVar (datatype: datatable)
right side: the statement from above
feel free to explore following as well:
Surprising that column name and filter value differs from your sample from above.
However if the statement is not working with your data then do following:
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.