home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:10311 comp.unix.programmer:4416
- Newsgroups: comp.unix.questions,comp.unix.programmer
- Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!access.usask.ca!ccu.umanitoba.ca!umnoor
- From: umnoor@ccu.umanitoba.ca (Nasir Ahmed Noor)
- Subject: RE: ``Sort'' Problem (addition)
- Message-ID: <1992Aug23.230602.2708@ccu.umanitoba.ca>
- Followup-To: poster
- Organization: University of Manitoba, Winnipeg, Canada
- Date: Sun, 23 Aug 1992 23:06:02 GMT
- Lines: 39
-
-
- I posted a question as:
- I am trying to sort following lines (this is an example)
-
-
- the value of this line is 1
- the value of this line is 2
- the value of this line is 10
- the value of this line is 40
- the value of this line is 6
-
- I want result to be like:
-
- the value of this line is 1
- the value of this line is 2
- the value of this line is 6
- the value of this line is 10
- the value of this line is 40
-
- The ``sort'' give me result like:
-
- the value of this line is 1
- the value of this line is 10
- the value of this line is 2
- the value of this line is 40
- the value of this line is 6
-
- I want to make on addition,
- The strings to be sorted will not always of same length. So I can't use
- the ``sort -n +6'' command. I know that sort goes character by character.
- How to tell sort that when ever it encounters a numerical value, treat
- it as whole number and not go digit by digit there.
- (I could have strings of varrying length with numbers not necessarily
- appearing at the end always so I cand use sort -n +6 etc)
-
- thanks
- --nasir
- umnoor@ccu.umanitoba.ca
-
-