Filter Datatable based on length

Hi all,
Book13.xlsx (8.3 KB)
I have an excel, in that excel there is one column called “Orders”. Now I want to filter it based on the length.Suppose if the length is < 9 need to copy all the contents into a new sheet

1 Like

Hi @Shivaraju,
And if it is more than 9 like what you have in the attached excel, then you dont want to copy ?

Hi @NishantRastogi
I want to copy the row data(All columns) if the orders column length <9.

here you go buddy
Hope its resolved
length.zip (18.7 KB)

kindly try this and let know buddy
Cheers @Shivaraju

1 Like

@Shivaraju

Use Filter DataTable activity.

image

5 Likes

did that work buddy @Shivaraju

Hi @Palaniyappan
Checking bro, Please wait…

1 Like

Hi @Palaniyappan

         **
  • Thank-you buddy, it is working. But I had more number of columns(nearly 30 columns) in excel by using Add Data Row it will be more complicated in my workflow.

**

Hi @lakshman
Thank you for your reply. I had used “Orders”.length in Filter Datatable Activity and after that used write range activity. But it printed empty sheet. Could you please correct me.

@Shivaraju

Try this:

  1. use Read Range activity to read data from excel and will give output as dataTable and say ‘inputDT’.

  2. Assign, outputDT = inputDT.AsEnumerable().Where(Function(row) row(“Orders”).ToString.Length < 9).CopyToDataTable

  3. use Write Range activity to write into excel and pass “outputDT” to it.

5 Likes

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