According to Georg Müller on 4/24/2007 6:22 AM:
> Dear coreutils team,
> 
> I would like to see a "sort by line length" in the sort tool.
> 
> Is anything like this planned.

Not really planned, but it doesn't sound all that bad to me.  Submit a
patch for discussion, if you would like.  But it sounds non-trivial (don't
forget the documentation and testsuite), so you will need copyright
assignment on file.

> It seems easy to implement.
> I could also write the code for that, if you wish.

It may be possible to already do this with existing tools, although
certainly not conventional.  For example, it can probably be achieved
already by writing a custom locale that treats all bytes as the same
collation class, so that strcoll then compares according to line length.
Or you could use a series of operations, such as sed to number the lines
and convert all remaining characters to a single character, sort the
converted file by the reduced key, and then use the resulting order of the
line numbers as the directions for which order to retrieve lines from the
original file.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to