Find a number
Hello,
I am sending number from a coll to a jit.cellblock and now I would like to find if there are repeated numbers and, if it finds a number, to add a counter in the next colunn.
Is that possible to do directly in a coll?
Thanks
I think that you are not going to get much help on this with so little information. Are you able to post any patch that you have created so far and/or more detail about the scope of these numbers - integer/float, range of values. Is your [coll] currently just a list of single values or is there other data in there as well.
coll allows only operations to adresses (not to the data content): sort, insert, move, next, renumber, call and return, associate, dump all, delete... and file in/out.
"check if it contains free beer, and if yes, multiply the 3rd element with 77" has to be done outside.
building a generalized routine of the sort "get the data from index 3, do something with it, write the result back into index 3" is not complicated.
the help file might not show all commands, you want to look into the object´s reference.
I guess he wants to add repetitions into same row.
If it is so, then :

Hello,
Thank you for your help.
I am sorry for had given so little information.
What I am trying to do is to receive numbers with 9 digits; add a extra digit - for counting; and, if the number is repeated, to add 1 to the counter - the extra digit.
I am using the coll to kepp data and the zl.look to extract the numbers from the coll and to compare.
My patch is now too much confunsing. Actually I have two in the same one. The first is keeping the data and comparing (above). The second one (below) I was developing it to add 1 to the digit number 10.
Maybe it´s to confunsing. I will try to clean it and I will post it again.
Thank you very much for your help
you should never name a patch same as existing max object/external.
post comments in the patch in english ...
and yes, it is not clear what you want to do.
I understand feeding a coll with 9 digit numbers,
adding indexes using idx (same could be done with counter).
Allready there you could merge as shown in my example
to stack repetitions and do something with them,
for example add number of repetitions as that "extra" digit
....
what is completely confusing is how many digits you want to add to
original 9 ones ?
if you receive more than 9 numbers, you can't just add 1 digit- digit number 10.
I hope you understand waht one digit is ?
one single item 0-9
have a look at this, is that kind of what you want ?

Thanks,
in what you´ve send each repetition goes to a new colunn, is that right?
It could work. I was thinking adding the number of repetitions to the number. Something like this:
999999999 2 - meaning this number was sent twice
888888888 5 - meaning this number was sent five times
I know what a digit is. I was thinking in something like the image.

But maybe what you´ve sent could work for my intention. The problem it will be if a number has high number of repetitions.
Thank you very much
one can avoid adding repetitions to columns,
but add only number of repetitions if you want that,
or add IDs as they get in into new columns and count number of repetitiins
on coll dump.
But I don't see any use for numbering ID's of incomming numbers ?
if you have 999999999 9
that means it got ID 9 ,
a repetition could have ID 88.
what then ?
makes no sense.
Either remove ID's and only count number of repetitions,
or maybe keep very first ID of a number and add number of repetitions as
THIRD value :
999999999 16 3 (16 was first ID) (number got repeated 3 times)

P.S. If you don't want to use ID's at all use this

I´m not sure I understood de IDs.
Is the IDs refering to a col $ and row $?
So, can you show me the solution if to count repetitions in a colunn?
I was looking to do something simple.
Receive a number > if the number doesn´t exist it should put in a new IDX (in a coll) or a row (in cell) > if the number already exist it ativates a counter addind an adjacent number counting the repetitions (example: 21 2; the number 22 had shown twice).
I´m sure there is a easy way to do this but I can´t figure out.
I see now what you posted. I think is this.
Thanks
Yes, is really what I was looking for!
Thank you very much!
I get almost all code but I don´t understand how the Coll result gets the info.
Do you mind to explain me?
So, the coll result is counting the colunn from coll merger, right? but from where?
Thanks once again
in coll we use terms index for address, and data which can be single item
or list of several types of items.
that could translate into column 0 in jit.cellblock for index
followed by other values into subsequent columns in one row.
coll result receives 2 or 3 items, depending on which version you decided to use :
with or without ID's of received numbers.
last item is number of occurances
which gets reported from zl.len (reports list length).

Perfect, thank you!