Counting unique items in a file

Dan Friedman dan at
Mon Apr 27 13:34:07 EDT 2020


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


On 4/27/20, 10:25 AM, "use-livecode on behalf of Skip Kimpel via use-livecode" <use-livecode-bounces at on behalf of use-livecode at> 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?

    use-livecode mailing list
    use-livecode at
    Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the use-livecode mailing list