Delete row

I want to delete row that column Amount = blank.

image

remark : My real data have 4K rows

Please guide me about it.

1 Like

Hi

Hope the below steps would help you resolve this

  1. Use a read range activity and get the output as dt

  2. Then Use this expression in a assign activity

dt = dt.AsEnumerable().Where(Function(a) NOT String.IsNullorEmpty(a.Field(of String)(“Amount”).ToString.Trim)).CopyToDatatable()

  1. This will remove rows with amount column being blank

  2. Then we can use this with write range and passing dt as input and enabling add headers to write it to a excel file

Cheers @fairymemay

1 Like

@fairymemay

Try below expression.

         dtOutput = dtInput.AsEnumerable.Where(Function(row) Not String.IsNullOrEmpty(row("Amount").ToString.Trim)).CopyToDataTable

And then use Write Range activity and pass above output DataTable to write into excel file and delete original input sheet.

1 Like

@Palaniyappan It error as below.

Check once whether datatable is having some value

Use a writeline and mention like this

Dt.Rows.Count.ToString

If this shows as 0 check once the source of input

@fairymemay

1 Like

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