Row count of a specific column

Hello

I need to get the row count of a specific column from the Datafile. The data file is in CSV format.

column1,column2,column3
one,two,three
one,two,three
one,two,three
,two,three
,two,three
,two,three
,two,three
,two,three
,two,three
,two,three
,two,three
,two,three
,two,three
,two,three
,,three
,,three

In the above CSV file how can I get the row count of the column2.

Is the row count of column two the same as column one and three or is your idea of row count only for the list of actual values? As an example, the row count of column one would be three.

Hi @grylion54
Yeah…I need the row count of a particular column… Like the row count of cloumn2 is 14.

How about?

def cnt = 0
def row = 1  /* use 2 if you have a heading row */

info.col2 = data.getValue(2, row)

while (info.col2 != "") {
	cnt += 1
    row += 1
	info.col2 = data.getValue(2, row)
}

WebUI.comment("we have ${cnt} rows" )
2 Likes