D
David Trimboli
I've got a couple of sorting challenges. Maybe they're easy, maybe they're
well-documented, but I haven't seen the answers yet. I'm looking for
solutions that involve no third-party products, and avoiding the use of
temporary files is good, but not necessary. Single-command answers are
best, but batch scripts are acceptable.
I've got a list of names in a text file. The names are not sorted in any
way. They all consist of at least two space-delimited tokens, but may have
more. For instance:
John Doe
Jane Doe
William C. Smith
Joe de la Someone
Frank Alpha
James T. Kirk
[...]
PROBLEM 1: Assuming this is a long list, what command can be used to
identify any duplicate names in the list? (Duplicate names will always be
totally identical. John Doe and John B. Doe are not duplicate names.)
PROBLEM 2: What command will sort this list by last name?
David
Stardate 4598.3
P.S.: This isn't important, but it will satisfy questions I have about
sorting text files in Windows. It reflects a real problem I encountered
yesterday.
well-documented, but I haven't seen the answers yet. I'm looking for
solutions that involve no third-party products, and avoiding the use of
temporary files is good, but not necessary. Single-command answers are
best, but batch scripts are acceptable.
I've got a list of names in a text file. The names are not sorted in any
way. They all consist of at least two space-delimited tokens, but may have
more. For instance:
John Doe
Jane Doe
William C. Smith
Joe de la Someone
Frank Alpha
James T. Kirk
[...]
PROBLEM 1: Assuming this is a long list, what command can be used to
identify any duplicate names in the list? (Duplicate names will always be
totally identical. John Doe and John B. Doe are not duplicate names.)
PROBLEM 2: What command will sort this list by last name?
David
Stardate 4598.3
P.S.: This isn't important, but it will satisfy questions I have about
sorting text files in Windows. It reflects a real problem I encountered
yesterday.