Counting unique items in a file

Skip Kimpel skiplondon at gmail.com
Mon Apr 27 15:05:16 EDT 2020


Silly me... of course.  Thank you, Dunbarx for pointing out the obvious :)

SKIP

On Mon, Apr 27, 2020 at 2:27 PM dunbarx--- via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Hi.
> You are getting empty because the information returned from the function
> is an array.
> "combine " the array with "return and "comma"
> Craig
>
>
> -----Original Message-----
> From: Skip Kimpel via use-livecode <use-livecode at lists.runrev.com>
> To: Dan Friedman <dan at clearvisiontech.com>
> Cc: Skip Kimpel <skiplondon at gmail.com>; How to use LiveCode <
> use-livecode at lists.runrev.com>
> Sent: Mon, Apr 27, 2020 1:52 pm
> Subject: Re: Counting unique items in a file
>
> Thanks Dan!
>
> Upon very quick implementation, I am getting empty results back.  I think I
> need to play around with this a little bit more but I feel you got me on
> the right track.
>
> Thanks again,
>
> SKIP
>
> On Mon, Apr 27, 2020 at 1:34 PM Dan Friedman <dan at clearvisiontech.com>
> wrote:
>
> > Skip,
> >
> > Haven't tested, but pope about this...
> >
> > function getUniqueNames inData,pColumn
> >  put "" into uNames
> >  set the itemDel to tab
> >  repeat for each line l in inData
> >    add 1 to uNames[item pColumn of l]
> >  end repeat
> >
> >  return uNames
> > end getUniqueNames
> >
> > You should get back an array keyed by the unique names, and how many
> > instances of each one
> >
> >
> > -Dan
> >
> >
> >
> > On 4/27/20, 10:25 AM, "use-livecode on behalf of Skip Kimpel via
> > use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of
> > use-livecode at lists.runrev.com> wrote:
> >
> >    Good afternoon LC'ers,
> >
> >    I am loading a tab delimited file into a variable and I need to pull
> > out
> >    all unique names from a certain column (let's say column 10) and count
> > how
> >    many times that name appears in that column.
> >
> >    I know there has to be an easy way of doing it.  Every time I try to
> > start
> >    coding this it get waaaayyy too long :)
> >
> >    Simple approach?
> >
> >    SKIP
> >    _______________________________________________
> >    use-livecode mailing list
> >    use-livecode at lists.runrev.com
> >    Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> >    http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list