This would be very complex (not difficult, just complex), you can use Regular Expressions to pin-point where each occurance of a 10 digit set of numbers are (i.e. nnn-nnn-nnnn). Load each line into a 2 dim array with the second element holding the starting positon of the phone number, then maybe do a bubble-sort.
At the top of my head this makes sense to me, perhaps someone can come up with something better.