Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3688

Help with dictionary for counting

$
0
0

I am reading values a SQLITE database and want to create a dictionary based on the values in a specific column. The dictionary would have a key of the text string from the database, and the value would be a count of the number of times that the string has appeared. Problem is, I don’t know what the values are in the DB until I run the select statement.

In short, how can I build a count of the number of times each string appears in a column, using a dictionary?

As an example, the below table would produce the dictionary underneath:

Cities
London
Manchester
London
Manchester
Birmingham
Reading
Reading
Reading
Londn
Newcastle
Newcastle

|London|2|
|Manchester|2|
|Birmingham|1|
|Reading|3|
|Londn|1|
|Newcastle:2|

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3688

Trending Articles