GNU bug report logs - #20511
split : does not account for --numeric-suffixes=FROM in calculation of suffix length?

Previous Next

Package: coreutils;

Reported by: Ben Rusholme <rusholme <at> caltech.edu>

Date: Tue, 5 May 2015 20:45:03 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 20511 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Ben Rusholme <rusholme <at> caltech.edu>, 20511 <at> debbugs.gnu.org
Subject: Re: bug#20511: split : does not account for --numeric-suffixes=FROM
 in calculation of suffix length?
Date: Wed, 06 May 2015 18:48:08 +0100
On 06/05/15 18:37, Ben Rusholme wrote:
> Hi,
> 
>> 4. Auto set the suffix len based on FROM + CHUNK.
>> That would support use case 1 (single run),
>> but _silently_ break subsequent processing order
>> of outputs from multiple split runs
>> (as FROM is increased in multiples of CHUNK size).
>> We could mitigate the _silent_ breakage though
>> by limiting this change to when FROM < CHUNK.
>>
>> 5. Document in man page and with more detail in info docs
>> that -a is recommended when specifying FROM
>>
>> So I'll do 4 and 5 I think.
> 
> Thanks, that would solve the problem I was having.
> 
> Please feel free to end this conversation here, but if you can spare the time I’d be very interested in an example of a multiple split run for my own education/understanding/curiosity? I assume you mean processing subsets of the input, but can’t see how to do that (after experimenting on the command line and searching the documentation) except —number=l/k/n which does know the size of the total set?

Well you could process subsets but even more simply
consider splitting a set of input files in 2,
to a set of output files.

  i=0
  for f in *.dat; do
    split -a4 --numeric=$i $f -n2; i=$(($i+2))
  done

(to be truely generic you would set the -a parameter
 based on the number of files and -n).

cheers,
Pádraig.




This bug report was last modified 10 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.