home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10311 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  1.6 KB

  1. Xref: sparky comp.unix.questions:10311 comp.unix.programmer:4416
  2. Newsgroups: comp.unix.questions,comp.unix.programmer
  3. Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!access.usask.ca!ccu.umanitoba.ca!umnoor
  4. From: umnoor@ccu.umanitoba.ca (Nasir Ahmed Noor)
  5. Subject: RE: ``Sort'' Problem (addition)
  6. Message-ID: <1992Aug23.230602.2708@ccu.umanitoba.ca>
  7. Followup-To: poster
  8. Organization: University of Manitoba, Winnipeg, Canada
  9. Date: Sun, 23 Aug 1992 23:06:02 GMT
  10. Lines: 39
  11.  
  12.  
  13. I posted a question as:
  14. I am trying to sort following lines (this is an example)
  15.  
  16.  
  17.         the value of this line is 1
  18.         the value of this line is 2
  19.         the value of this line is 10
  20.         the value of this line is 40
  21.         the value of this line is 6
  22.  
  23. I want result to be like:
  24.  
  25.         the value of this line is 1
  26.         the value of this line is 2
  27.         the value of this line is 6
  28.         the value of this line is 10
  29.         the value of this line is 40
  30.  
  31. The ``sort'' give me result like:
  32.  
  33.         the value of this line is 1
  34.         the value of this line is 10
  35.         the value of this line is 2
  36.         the value of this line is 40
  37.         the value of this line is 6
  38.  
  39. I want to make on addition,
  40. The strings to be sorted will not always of same length. So I can't use
  41. the ``sort -n +6'' command. I know that sort goes character by character.
  42. How to tell sort that when ever it encounters a numerical value, treat 
  43. it as whole number and not go digit by digit there. 
  44. (I could have strings of varrying length with numbers not necessarily
  45. appearing at the end always so I cand use sort -n +6 etc)
  46.  
  47. thanks
  48. --nasir
  49. umnoor@ccu.umanitoba.ca
  50.  
  51.