Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

names.txt Mike Millon 2 50000 Allen Border 1 2000 Gram Swan 8 150000 Steve Borde

ID: 3881336 • Letter: N

Question

names.txt

Mike Millon 2 50000

Allen Border 1 2000

Gram Swan 8 150000

Steve Border 3 6000

James Anderson 1 3000

Micheal Scott 3 6000

Adam Bata 1 4000

Alex Hopes 7 200000

In this le, each line corresponds to an author who has worked with the publisher.
Each line has four elds, and they are, from the rst eld to the last, rst name, last
name, the number of books authored and the total number of copies printed (of all
the books that this author has written). A single space character is used to separate
two elds. The rst character of each rst or last name is capitalized, and the rest are
lowercase characters.

Use UNIX command sort, uniq, cut, cat, wc, head or tail to answer the following question.

In the example le given, dierent authors might have authored the same number of books. This can be retrieved from the 3rd eld across all lines of this le. Use a command line to print a single integer that tells how many dierent values occur in this eld, so the publisher knows how many distinct values are among the numbers of books authored by these authors.

Explanation / Answer

Adam Bata 1 4000

Alex Hopes 7 200000

Allen Border 1 2000

Gram Swan 8 150000

James Anderson 1 3000

Micheal Scott 3 6000

Mike Millon 2 50000

Steve Border 3 6000

Adam Bata 1

Allen Border 1

James Anderson 1

Micheal Scott 3

Steve Border 3

4000

200000

2000

150000

3000

6000

50000

6000