Unable to read column data in excel sheet


hi ,

i have excel sheet with column name “PT” It contain records 4 or may vary (more or less or empty) . i am trying to get only one colum data.i tried to get the total count of the whole excel rows in data table count is coming but unable to pick the “PT” COLUMN data. help

@anilkumar.vegi Use Read Column instead of Read Range

@anilkumar.vegi

Here you go
anilkumar.zip (9.2 KB)

Thanks Vishal.
i am able to get the count but i am not getting the column data. because i want to use each record in if clause to compare.
help here

@anilkumar.vegi

You can use for each activity and to iterate through the read column object. Please find the updated one here to read all the column data
anilkumar.zip (9.4 KB)

Thanks Vishal it worked…

1 Like

i applied same logic on B column. there it is empty data but it is showing included Column name(“Ind”) and count is coming as ‘1’ i started with B2. but same logic works to Column D
Help

Hi @anilkumar.vegi

Oh! actually its a problem of the read column activity it will check with the corresponding column as well and even if it is blank, it will be counted. So please find the updated workflow below.
anilkumar.zip (9.5 KB)

Also if in case you just want to get the nonempty row count for a particular column you simply use this Linq query

Int32 CountRowValue=var_dtDados.Rows.Cast(Of DataRow)().Where(Function(row) Not row.Item(“CIDADE”) IsNot DBNull.Value Or row.Item(“CIDADE”).ToString() <> “”).Count

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