0

I'm very new to Javascript and I'm encountering something I thought would be simple but I'm totally hitting a roadblock. I'm more familiar with PHP/MySQL, but I have to use Javascript for this because it will be running in Adobe InDesign.

I have a CSV file with limited data. I've created an array for it split by rows, and then created an array from that separating the "columns" of the CSV data.

What I want to do is count only the unique values contained among the first column.

I've tried a handful of different examples scattered across the web, but they all seem to generate an error. I'm not sure if this is because of some limitations of Adobe ExtendScript or if I'm thinking about Javascript all wrong...

I think the form I'm expecting part of this to take uses something along the lines of:

if (arrayWithColumns[0].includes(specificValue)) {
      // don't do anything
} else {
     allMyUniqueValues = allMyUniqueValues.push(arrayWithColumns[0]);
}

And then I'd use allMyUniqueValues.length to give me what I need...?

Am I even on the right track?

Thanks everyone/anyone!

0 Answers0