Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.shell Subject: Re: How to sort on right most column Message-ID: <1991May15.051707.9566@convex.com> Date: 15 May 91 05:17:07 GMT References: <13320@exodus.Eng.Sun.COM> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 25 Nntp-Posting-Host: pixel.convex.com From the keyboard of rock@warp.Eng.Sun.COM (Bill Petro): :How could I do this using either the sort command, or perl or awk? : :I have the following data in this format - I want to sort it on the :right most column. The columns are not tab delimited, and some of the :columns have arbitrary numbers of words (specifically the third column :from the left, column c). Sort assumes that you start numbering on the :left, and count from 0. How would you start with the right most :column, column e? : : FOO BAR ACE CORPORATION SUNNYVALE 2.00 : FOO BAR ACER COMPUTED COMPANY MILPITAS 20.00 How about? sort -t^A +0.60n Assumptions: no control-A's in data the sort should be numeric the numbers don't begin until column 61 --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "So much mail, so little time."