|
How to sort alphabetically after finding values
I have a list of people in a usage log and need to print the names and phone numbers of people with over 500 logins. I'd also like to display these names alphabetically.
I have their total logins set to a variable named total.
So far, I have very little in my awk script to do this:
FS=":"
{if ( total > 500 ) print $1, $2}
($1 being both first and last name, $2 being phone number)
There is more to the script than this, but above is the relevant portion.
This only prints one of their names unfortunately, even though my data file clearly has others with totals > 500.
Any advice or pointers here? Thanks!
|