Hello guru's!
I have a comma seperated file that contains nothing but numbers. All I need to know is the number of times that each number occures in the file. Is there a way to read a file and just pull out the number of times each number is listed, or do this in an array? The numbers are NOT sequential and there will not be all numbers listed. In other words, a single file may look like:
1,5,1,4,2,11,23,10000,2,3945,4,99,61
and another file may look like:
8,33,22,4
What I need to know is that in file #1, the Number 1 appears 2 times, the number 5 appears 1 time, 4 appears 1 time, 2 appears 2 times, etc. . .
There are a possible 10,000 numbers, so doing a series of if statements on the file is out of the question!
Any help? Thanks!
I have a comma seperated file that contains nothing but numbers. All I need to know is the number of times that each number occures in the file. Is there a way to read a file and just pull out the number of times each number is listed, or do this in an array? The numbers are NOT sequential and there will not be all numbers listed. In other words, a single file may look like:
1,5,1,4,2,11,23,10000,2,3945,4,99,61
and another file may look like:
8,33,22,4
What I need to know is that in file #1, the Number 1 appears 2 times, the number 5 appears 1 time, 4 appears 1 time, 2 appears 2 times, etc. . .
There are a possible 10,000 numbers, so doing a series of if statements on the file is out of the question!
Any help? Thanks!