Page 1 of 1

Sort

Posted: Wed May 01, 2013 9:24 am
by Nakia
Hi,
I need to sort a chuck of Tab delimted text decending by item 4 of each.
I have this below statement and it works BUT occasionally the value in item 4 of each will conatin a Negative number (Like below) and I want the sort to ignore that "-".

My Sort is
sort lines of tRacTen descending numeric by item 4 of each
Example if tRacTen
APX01520 2013-04-11 16:48:13 1 21686.0 17 228729.77 6609636.0 293.12
APX01520 2013-04-11 16:46:52 1 21109.0 21 228673.08 6609979.5 276.76
APX01520 2013-04-11 12:27:02 1 18084.0 15 228741.69 6609679.5 286.39
APX01520 2013-04-14 13:27:00 1 -18226.0 14 228177.78 6610446.5 254.99
APX01520 2013-04-14 07:43:24 1 -18267.0 14 228165.05 6610434.0 247.6
APX01520 2013-04-14 06:36:32 1 -18886.0 15 228515.87 6609596.0 297.47
APX01520 2013-04-13 04:09:01 1 -19675.0 17 228136.84 6610210.5 265.43

Re: Sort

Posted: Wed May 01, 2013 9:48 am
by bn
Hi Nakia,

try

Code: Select all

sort tRacTen descending numeric by abs(item 4 of each)
Kind regards
Bernd

Re: Sort

Posted: Wed May 01, 2013 9:52 am
by Dixie
Nakia...

Code: Select all

on mouseUp
   set itemdel to tab
   sort lines of fld 1  ascending numeric by ABS(item 4 of each)
end mouseUp
Dixie

Edit : Bernd... too quick for me.. :D

Re: Sort

Posted: Thu May 02, 2013 4:14 am
by Nakia
Ahhh, Absolute....You know, I remembered using this before but for the life of me couldn't remember what is what called :oops: