My script goes line-by-line through a file, explodes the line and looks at one or more of the variables there, makes note of it, and continue on. In all of those lines there is a specific variable that I'll call "category".
Of the 100 some odd "entries" in this flat database, there are only about 5 or 6 different categories.
I need the script to go through and look at the categories and make a list of them.
I can't figure out how to take my output of 15 "category A"s, 12 "Category B"s, 19 "Category C"s, and so on, and turn it into "Category A, Category B, Category C".
I don't want to hard code the categories into the script I want to be able to add more or get rid of some.
I've thought about putting each into an array and then checking the array versus the next line's variable and if it exists, skip it, if it's a new value, add it to the array.
This seems a little inefficient. Any thoughts?