in reply to Sort by specific column
have a look at this link: http://www.stonehenge.com/merlyn/UnixReview/col64.html it explains exactly what you need.
Cheers,R.