help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] split


From: Pierre Gaston
Subject: Re: [Help-bash] split
Date: Tue, 29 May 2018 16:50:42 +0300

On Tue, May 29, 2018 at 4:42 PM, Greg Wooledge <address@hidden> wrote:

> On Tue, May 29, 2018 at 04:22:56PM +0300, Pierre Gaston wrote:
> > awk can do the redirection, you may hit a problem if the number of open
> > files is too high, but with gnu awk you should be fine.
> >
> > awk  '{print > ("numb" $1 ".txt")}' atest.dat
> >
> > i'd suggest you use padding for the number so that lexical sorting works
> > e.g.:
> >
> > awk  '{print > (sprintf("numb%03d.txt", $1))}' atest.dat
>
> But....
>
> > On Sat, May 26, 2018 at 8:28 PM, Val Krem <address@hidden> wrote:
> > > The above script gave me 10  files while I was expecting only 3  files.
>
> We still have no idea what his basic splitting criteria are.  We
> can't write his program for him until we know this part.
>
>
ok, my guess is that he just didn't want to end up with empty files.


reply via email to

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