Reject the file with the semi empty lines in datatable

Hi ,
I have a datatable as below

Karthik:C1 C2
K1 KEEP KEEP
K2 KEEP KEEP
#KEEP
k3 KEEP KEEP
k4 KEEP KEEP
#KEEP
k5 KEEP KEEP

The datatable which has in between lines ,as in the above example 3rd and 6th line line as different value (#keep),if the same is there the datatable should be rejected.
only the proper format is accepted.in the line 3rd it can contain any string,the data table should be rejected.Can someone suggest.

Hi @karthik_kulkarni1

If the Column value is #KEEP then the other columns are null it will be same or it will change!

Regards

The other columns are null and first column can be any string not exactly as Keep

@karthik_kulkarni1

Check below for your reference

Reference

Hope this may help you

Thanks

Hi @karthik_kulkarni1

Try the below expression using LINQ

buildDT.AsEnumerable.Where(Function(x) not String.IsNullOrEmpty(x(“YourColumnwith null value”).ToString.Trim)).CopyToDataTable()

Refer to the xaml below!
NewFile.xaml (8.0 KB)

Regards