Hi,
I have 1 excel having some column names A B C D
I need the count of empty rows
(condition : column A must have data and D is empty then count no of empty rows of D column)
Can anyone help me here…
thanks…
Loop through it
Set counter = 0
check
if row(“D”)is null or empty using a series of if statement for each condition.
If each cell is empty, then add 1 to counter
Then write it
Happy Automation
better to tell, what exactly is not working
Maybe the data has some spaces and would require a trim before checking
Alternate:
Assign activity:
myCount | int32 =
(From d in YourDataTableVar.AsEnumerable
Where Not ( isNothing(d("ColA")) OrElse String.IsNullOrEmpty(d("ColA").toString.Trim) )
Where isNothing(d("ColD")) OrElse String.IsNullOrEmpty(d("ColD").toString.Trim)
Select r=d).Count
we do feel that your statement differs from ours.
->(From…) ← .Count
Just recheck and correct
You can achieve this by using the following steps:
- Read the Excel file into a DataTable using the Read Range activity.
- Initialize a variable to keep count of the empty rows. Let’s call it
emptyRowCount
and set it to 0. - Iterate through each row in the DataTable.
- For each row, check if Column A is not empty and Column D is empty. If both conditions are met, increment
emptyRowCount
by 1. - After processing all rows,
emptyRowCount
will contain the count of empty rows where Column A has data, and Column D is empty.
Thanks!
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.