I had a text file recently and I wanted this sorted by surname, you could do this in vi, I was wondering if there was a nice simple way to accomplish this.
You can easily do this on a command line from a Mac, or from a Linux machine, the nice easiest way is below.
sort -k2 < orginal_file > new_file
The k2 above is the second field, if you wanted to sort on another field then you can change the 2 for the filed you want to sort on.