If you have a file named phone-numbers.txt that looks like this:
207-568-6723
617-277-2343
207-822-9645
603-314-5892
800-233-3413
Doing "sort phone-numbers.txt" will end up sorting by area code.
What if you want to sort by the last 4 numbers?
|
sort -n phone-numbers.txt |
||
|
sort -t\- -k3 phone-numbers.txt |
||
|
sort [[:allnum:]]$ phone-numbers.txt |
||
|
cat -r phone-numbers.txt | sort -rn |
If you have a file named phone-numbers.txt that looks like this: 207-568-6723 617-277-2343 207-822-9645 603-314-5892 800-233-3413...
Create a program that will use the attached input file and perform the following operations. Read the file into an appropriate JCF data structure. Look up a (list of) names and numbers matching a last name or the first letters of a last name, ignoring case. Look up a (list of) names and numbers matching a number or the first digits of a number. Add a name and number to the list. Sort the list by first name, last name...