Sign in to follow this  
Followers 0
ca143508

ListviewItem Count

2 posts in this topic

Guys,

I am looking for a peice of code that will count the number of times an instance occurs in a selected column.

For example:

ID|NAME|DAY|TOTAL

1|BILL|MONDAY|3

2|JOAN|MONDAY|3

3|GRANT|TUESDAY|4

The result here would be "2" if I wanted to count the number of times 3 appeared in column 3.

It would be even better if I could specify a count that says something like "Count the number of lines where column 3 contains a number less than 7".

Any help would be great.

Cheers,

Mike.

Share this post


Link to post
Share on other sites



Guys,

I am looking for a peice of code that will count the number of times an instance occurs in a selected column.

For example:

ID|NAME|DAY|TOTAL

1|BILL|MONDAY|3

2|JOAN|MONDAY|3

3|GRANT|TUESDAY|4

The result here would be "2" if I wanted to count the number of times 3 appeared in column 3.

It would be even better if I could specify a count that says something like "Count the number of lines where column 3 contains a number less than 7".

Any help would be great.

Cheers,

Mike.

So what you need is a loop that loops _GUICtrlListViewGetItemCount times, using StringInStr on the results of _GUICtrlListViewGetItemText to look for the text in the desired column. About 4 lines of code.

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0