Subject: RFE: split --balanced

From: Dave Yost <[email-masked]>
Date: Tue, 6 Sep 2011 17:55:51 -0700

Z% for x in 1 2 3 4 5 6 7
for> do echo $x ; done | split --lines=3 \
pipe> && for x in x?? ; do echo "=== $x" ; cat $x ; done
=== xaa
1
2
3
=== xab
4
5
6
=== xac
7

In some applications, you would like split to more evenly apportion 
the output to the files, like this:

Z% for x in 1 2 3 4 5 6 7
for> do echo $x ; done | split --balanced --lines=3 \
pipe> && for x in x?? ; do echo "=== $x" ; cat $x ; done
=== xaa
1
2
3
=== xab
4
5
=== xac
6
7