coreutils
[Top][All Lists]
Advanced

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

Re: csplit - split by content of field


From: Pádraig Brady
Subject: Re: csplit - split by content of field
Date: Thu, 28 Feb 2013 03:41:38 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 02/07/2013 04:39 PM, Pádraig Brady wrote:
> On 02/07/2013 03:02 PM, Assaf Gordon wrote:
>> Pádraig Brady wrote, On 02/06/2013 05:38 PM:
>>> On 02/06/2013 10:09 PM, Assaf Gordon wrote:
>>>>
>>>> Attach is a patch that gives 'csplit' the ability to split files by 
>>>> content of a field.
>>>>
>>> Yes such a feature is useful, though maybe in conjuntion with uniq:
>>> http://lists.gnu.org/archive/html/coreutils/2011-03/msg00000.html
>>>
>>> So basically the proposal there is to support --suppress-matched
>>> so that you could then do:
>>>
>>> uniq -w1 --unique=separated --all-repeated=separated |
>>> csplit --suppress-matched '/^$/' '{*}'
>>>
>>> The caveat with that though is that uniq would
>>> benefit from better field selection, which is
>>> also on the TODO list.
>>>
>>
>> uniq with fields is indeed useful, but the example above seems a bit long 
>> for something that can be acheived natively with just csplit (IMHO) - what 
>> do you think ?
> 
> My first reaction was I was wary about adding field processing to csplit.
> Though I've not thought much about it.
> I'll think a bit more when I have time.

I think it's better to just add better field processing to uniq,
and add a --suppress-matched option to csplit.

thanks,
Pádraig.



reply via email to

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