in reply to sort utility key specification
I occasionally need to sort financial files from mainframes, so I'd love to see flags for packed decimal fields. I have a script that I use to patch up these files into text for sorting, but it would be nice to skip that step.
Also, I don't know whether your n flag means that the sort routine expects binary values in your records, or text strings representing numbers. If it means your records contain binary values, I'd really like to sort a numeric text column in natural order:
unsorted sorted ---------- ---------- xxx1 xxx xxx1 xxx xxx11 xxx xxx 5 xxx xxx 5 xxx xxx 010xxx xxx010 xxx xxx11 xxx
Regarding your comment about gnu sort: I know what you mean. I use it infrequently enough that I can't remember just how to specify what I want, but often enough to wish it was easy to remember. I generally have to sort the file a few times before I can get the switches just right.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sort utility key specification
by BrowserUk (Patriarch) on Apr 21, 2012 at 14:01 UTC | |
by roboticus (Chancellor) on Apr 21, 2012 at 14:31 UTC | |
by BrowserUk (Patriarch) on Apr 21, 2012 at 15:14 UTC | |
by roboticus (Chancellor) on Apr 21, 2012 at 16:57 UTC | |
by davies (Monsignor) on Apr 21, 2012 at 20:06 UTC | |
by BrowserUk (Patriarch) on Apr 22, 2012 at 05:11 UTC |