in reply to Re^3: String sorting in Perl
in thread String sorting in Perl
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: String sorting in Perl
by Laurent_R (Canon) on Jun 04, 2014 at 18:47 UTC | |
by markdavis87 (Novice) on Jun 04, 2014 at 18:54 UTC | |
by Laurent_R (Canon) on Jun 04, 2014 at 19:06 UTC | |
by markdavis87 (Novice) on Jun 04, 2014 at 19:47 UTC |