in reply to Re^4: Dear Monks
in thread Dear Monks

If I were you, then I'd sort the file using a system utility like the linux sort command (as sundial and others have suggested). Then all your "abcd" would already be grouped. You could then print them as you encountered them, and only track one "abcd" symbol at a time, writing back to a file or to the screen each time the symbol changed.

if your data took this form:

abcd, GS abcd, GT abcd, HI abcd, HI abcd, UK abcd, US abce, AK abce, AZ abce, GB abcf, UT abcf, US

Can you see how you'd not need to keep track of every symbol (abcd, abce, abcf) all in one hash at once? You could simply read a line at a time, and tally them appropriately, and everytime you noticed that you were no longer reading abcd, but now some different symbol, you'd just need to reinitialize in a loop a new tracking set...

Why don't you try that, and if you still can't get it, come back and ask more questions. Good Luck... --Ray