Alright, the last thing I have to ask is how I append the count to the end of each distinct line in the final output. As it stands right now, I get:
ALPHA:D 20 letters ABCCEDFGGAACDDDEEEFG ALPHA:D 20 letters ABCCEDFFGAACDDDEEEFG ALPHA:D 20 letters ABCCEDFFGAACDDEEEEFG ALPHA:E 24 letters ABCCEDFFGAACDDDEEEFGAGAE ALPHA:E 24 letters ABCCEDFFGAACDDDEEEFGAGAD
which is great! But I need to have the count of each distinct string, spaced by a tab... I'd like it to look like this:
ALPHA:D 20 letters ABCCEDFGGAACDDDEEEFG 4 ALPHA:D 20 letters ABCCEDFFGAACDDDEEEFG 3 ALPHA:D 20 letters ABCCEDFFGAACDDEEEEFG 2 ALPHA:E 24 letters ABCCEDFFGAACDDDEEEFGAGAE 7 ALPHA:E 24 letters ABCCEDFFGAACDDDEEEFGAGAD 5
Is there an easy way to do this?
In reply to Re^4: String sorting in Perl
by markdavis87
in thread String sorting in Perl
by markdavis87
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |