help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting on compound keys?


From: Andreas Röhler
Subject: Re: Sorting on compound keys?
Date: Wed, 25 May 2011 07:58:44 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10

Am 24.05.2011 22:57, schrieb Tim Landscheidt:
Hi,

sometimes I want to sort unified diffs of CSV files (sepa-
rated by tabs (here: \t)):

| +A 1\t1\tx
| +A 1\t2\ty
| +B 2\t3\tz
| -A 1\t1\tx
| -B 2\t2\ty
| -B 2\t3\tz

by the second column, then the first column, then "+" vs.
"-". Unfortunately, it seems that sort-regexp-fields doesn't
allow more than one match field as a key. sort-fields
doesn't work either as it requires the fields to be sur-
rounded by white space (no "+" vs. "-") and doesn't allow
white space inside the fields.

   Is there any function in vanilla Emacs (23.1.1) that I
missed? I looked at pimping sort-regexp-fields, but it seems
to me that sort-subr would have to be rewritten from scratch

Hi,

last time I looked into that feature was missing indeed.
However, didn't look for a need of re-write from the scratch, just to extend to existing routine - ie. introduce one or more levels of sorting.

Cheers,

Andreas

to achieve sorting on compound keys.

Tim







reply via email to

[Prev in Thread] Current Thread [Next in Thread]