On 14/12/2007, at 01:42 , Errol Sayre wrote:

Indeed, the Sort Lines.sh script in the Unix Filters palette uses the "-n" option to sort strings by numerical value.

Just be wary of misinterpreting the intent of command line options - "-n" causes sort to treat strings as numbers where they can be interpreted as such.

Thus, given these lines of text:

  20
 15
   34

"sort" will sort thus:
   34
  20
 15

"sort -n" will sort thus:
 15
  20
   34

That is, the string "15" is interpreted as the number 'fifteen', not the digits "one" followed by "five", nor as "fourty nine" followed by "fifty three" (the ASCII character codes).

But as a previous poster suggested, if the OP could post some sample text and an indication of how they expect it should be sorted, others on the list could have something to chew on during their copious spare time ;)

Regards
Alex


--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to