coreutils
[Top][All Lists]
Advanced

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

Re: 'sort' command -- support more than one field-delimiter


From: Bernhard Voelker
Subject: Re: 'sort' command -- support more than one field-delimiter
Date: Wed, 18 Oct 2023 13:48:56 +0200
User-agent: Mozilla Thunderbird

On 10/16/23 08:35, Dani Moncayo wrote:
On Mon, Oct 16, 2023 at 8:19 AM Dani Moncayo <dmoncayo@gmail.com> wrote:

Maybe someone could figure out a better way of specifying several
field-delimiters.

Perhaps a long option, like:

If (and only if) such a feature would be added, then it would make sense
to generically solve the problem.

The sort keys are usually directly bound to the corresponding delimiter.

Using the initial example:

  SUSE 10.2 12/7/2006

In natural language, the problem could be described as:
  - with ' ' as the delimiter,
  - take the 3rd field,
  - there, with '/' as delimiter,
  - sort by key 3, 1 and 2 numerically.

Therefore, melting the delimiters into a list like ...

$ sort --field-separators=" /" -n -k5 -k3 -k4 file1.txt

... would not tell correctly which keys to sort by, would it?

Have a nice day,
Berny



reply via email to

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