Delete data row from data table

Hi @trabart,

Please find the attachment
RemoveDatarowNew.xaml (8.2 KB)



Yaaaaay thanks! It works great!

Hi @aksh1yadav

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.

Please help !

Hi there,

I was able to get it resolved by posting a parallel thread. Should anyone visit this page with the same issue, here is the solution

Thanks guys!

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.

Hope it will help in some or the other way.

Sample.xlsx (9.5 KB)
Delete-Append-Row.xaml (22.0 KB)

Dear All

please need support if i have column and i have many value but i iwant to remove any value start with (P & S) and keep remaining any support for that

thanks all for your support

Hello, what should be the expression in order to select the values in column [Status] and compare if lower than a local variable A?

Thaks a lot

Hi @Stefano_Skjupyter

It would look like that:

yourDataTable.Select("[Status]<" + localVariableA.ToString + "")

1 Like

Hello @balupad14

If i want to select the row in column [Tiltle] that contains the string written in the variable temp.

For example if “the” is contained in “the sun is bright”

With this code i have an error
DT1.Select("[Title] like ‘"& temp &"’")

The error is: can’t find the column named “The”
But infact i want to look if “The” is contained in a sentence written in a cell of the column [Title]…

Can you help with that?

Hi @aksh1yadav are you sure this the right syntax? to look if a string is contained in the column?


Hey @Stefano_Skjupyter

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 :slight_smile:

Yes it is :slight_smile:

you can use one of the way:
dt.Select("[ColName] like '*Forward:*'")


dt.Select("[ColName] like '%Forward:%'")


1 Like

@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…

Hey @Stefano_Skjupyter

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 :slight_smile: Too

so just try this : - dt.Select("Convert([ColName],System.String) like '%Forward:%'")

Reference Thread - DataTable Select function cannot perform “=” operation on System.Double and System.String


1 Like

Thanks a milion @aksh1yadav it works!!


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?

Hey @Stefano_Skjupyter

Do you mean a Column datatype is Int?

May i know how your using it? Any Screenshot?

To fix it just do like a sample screenshot. :slight_smile:



Ok lest’start from the beginning.
Please run the code attached.

First, the system cannot convert do double
Second, the data row activity gives the error that the current row of the ForEach belongs to another table

Can you help with that?
Book1.xlsx (17.6 KB)
Process.xaml (33.5 KB)

Hey @Stefano_Skjupyter

Check it out: - Process(1).xaml (33.8 KB)


That’s great it works! thanks a lot!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

Sign Up Log In