How to Detect An Empty Cell from csv file?

Guys,

If I intend to detect any cell with empty content from a data table, what option I can get here?
for example, i have read csv as a data table - dt_csv

then I used dt_csv.Rows(1)(“MSISDN”).ToString.Length = 0 but it returns me with

I assume this expression could not be able to detect the empty cell?

I also tried this approach below:

If I used For-each still detected the empty cell -
row.Item(“MSISDN”).ToString = “”

My returned results shows it did not go into here if the cell without anything, so I am not sure where I should enhance.

Thanks!

@Victor_Victory

Try below expression.

        String.IsNullOrEmpty(row.Item(“MSISDN”).ToString.Trim)

@Victor_Victory

And also you can Filter DataTable.

      filterDT = inputDT.Select("MSISDN <> ''").CopyToDataTable

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