I have a data file that looks like the following:
The first column is the "ID" -- a string variable. The second column does not matter to me. I want to end up with
where the second column now counts how many entries there are in the original file that correspond with the unique "ID" in the first column.
Any solution in bash or perl would be fantastic. Even STATA would be good, but I figure this is harder to do in STATA... Please let me know if anything is unclear. Thanks!