How to remove duplicate values and count occurrences of strings

Can anybody think of a way to count string occurrences in vvvv?
I have a spread of strings and want to determine how many times all the distinct strings occur.
Of course, the first step must be to extract the distinct values.

My input spread looks like this:


aaron
alex
alex
alex
mike
tina
tina
vernon

The patch should result in two output spreads:


1
3
1
2
1


aaron
alex
mike
tina
vernon

My approach would be to hash the strings in some way and then build a matrix of matching.
But maybe there is some functionality already present which I missed.
Especially to remove duplicate entries. I cannot think of an easy way to do this.

you might want to have a look at my module CountOccurrence which is doing exactly what you need…
woei.modules

Thanks for sharing your module.
It works great.

I prepended it with a simple preprocessor to replace the corresponding symbols by XML entities (apos, quot, amp, lt and gt).

Otherwise the parsing fails when such a symbol is encountered.

UseEntities (XML).zip (1.0 kB)

i’m building a new patch (want to generate a tree or cloud of mp3 tags analysis) and i think this modules can help me a lot. In fact i’m totally stuck trying to output the name of artist without duplication. Ur modules help me a lot with the number of occurences, but as i don’t have a clue about xml and i don’t know how to output the other spreads i mean only the name of artist without duplication. thx for that module :)