Okay... I've got about 100 individual text files that each contain a list of song titles that somebody likes.
I want to create a script that will scan through the files and count the song titles. It would work like this:
Open text file
Get song title from first line
Search through song title array. If script hasn't encounted the song, add a new entry to an array.
Add "1" to that song's counter in the array
Go to next line and repeat this process to the end of file
Go to next file and repeat this process until end of all files
At the end of the process, it would output a list of all the songs it encountered in the files, and how many times each song appeared.
That's the process. But I have no idea how to turn this into a shell script (or AppleScript). Can anyone help me do this?
--Josh
I want to create a script that will scan through the files and count the song titles. It would work like this:
Open text file
Get song title from first line
Search through song title array. If script hasn't encounted the song, add a new entry to an array.
Add "1" to that song's counter in the array
Go to next line and repeat this process to the end of file
Go to next file and repeat this process until end of all files
At the end of the process, it would output a list of all the songs it encountered in the files, and how many times each song appeared.
That's the process. But I have no idea how to turn this into a shell script (or AppleScript). Can anyone help me do this?
--Josh