Jump to content

ListviewItem Count


ca143508
 Share

Recommended Posts

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.

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...