I actually need to keep my list items as strings, as they have leading zeros 
that need to be retained. How can I still achieve the same result? I assume I 
would need to box them, but I can't work out how to format it as I would like, 
that is:

'item' count
'item' count
...

On 11 Oct 2011, at 22:53, Ric Sherlock wrote:

>   ({. , #)/.~ 1 2 3 3 4
> 1 1
> 2 1
> 3 2
> 4 1
> 
> Backed by special code:
> http://www.jsoftware.com/docs/help701/dictionary/special.htm
> 
> 
> On Wed, Oct 12, 2011 at 10:37 AM, Henry Rich <henryhr...@nc.rr.com> wrote:
>>    (~. ,. #/.~) 1 2 3 3 4
>> 1 1
>> 2 1
>> 3 2
>> 4 1
>> 
>> 
>> Backed by special code.
>> 
>> Henry Rich
>> 
>> On 10/11/2011 5:33 PM, David Vaughan wrote:
>>> How could I count occurrences of the same number in a sorted list?
>>> 
>>> e.g. list =. 1 2 3 3 4
>>> 1 1
>>> 2 1
>>> 3 2
>>> 4 1
>>> 
>>> or something along those lines.
>>> 
>>> Thanks.
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>> 
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to