Originally Posted by ghostdog74
and also sort, if duplicates are all over the place
Yes, if the sorted result is what you want. Otherwise you may need read each line, and check subsequent lines for duplicates. If you use sort, use the "-u" option to eliminate duplicates.