Thanks for your quick response.
I however do not understand it entirely.
Maybe it will help me if I refer to the example:
We want to remove all rows that contain “PV”.
We need to assign data.Select(“[Status]=‘PV’”) to data_to_del
Instead of selecting the column named [Status], I want to select the second column (with index 1).
What does the zero of Columns[0] represent, and does Columnname means the header?
And why is it equal to 1?
I went through the entire thread but unfortunately, still havent been able to crack it. The difference in my case is. I have a datatable. It has no headers. I want to delete the rows where the first column (column0) contains the word “Engagement”.
when i use DimensionData.Select(“Column0=Engagement”) , it says it cant find Column0
I was able to use DimensionData.Select(“Column0<>‘’”) without any issues. not sure why its causing issues here.
I think we should be able to achieve this easily through “remove data row” activity , but since my challenge remains that there are no headers, I am still stuck.
If you can guide me through a single line, or loop logic, i’m ok with both.
A comprehensive solution is attached. Below things are happening in the .xaml file
Directory: ‘C:\Temp’
Main File: ‘Sample.xlsx’ (Attached)
Requirement: Create a ‘Sample_Filtered.csv’ file with the same headers in the main file >> Delete all the rows except the header >> Copy rows from the main file where ‘Rate’ is greater than 175 >> Update the file.
Note: No impact is expected in Preformatted textthe main file.
Now seeing this topic and noticed Actually at the time of post i have not preformated text so you guys were not able to see dt.Select(“[Col1] like ’ Forward: '”) as it’s original form
it was dt.Select("[ColName] like '*Forward:*'")
or also you can below too
dt.Select("[ColName] like '%Forward:%'")
Now answer to your Question
Yes it is
you can use one of the way: dt.Select("[ColName] like '*Forward:*'")
@aksh1yadav thanks for the answer, i have a execution error saying, “Cannot perform ‘Like’ operation on System.Double and System.String”
What the reason for that? are all strings…
The Column datatype is double in excel. Cross check please
Internally ReadRange gnerates DataTable with types set for all columns as Object, but individual cell types are determined by what type Excel assigned.
This means that a value of “aksh12” will be stored as a String, but “12” as a number (so Double).
You can check it by iterating and checking the Type of each object Too
so just try this : - dt.Select("Convert([ColName],System.String) like '%Forward:%'")
Having a similar trouble.
I have an integer in a datatable, Using the Get Row Item activity I have the error " string converter cannot convert from System.Double"
After i have to compare if the data is lower than another. How should I set properly the conversion?