parallel
[Top][All Lists]
Advanced

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

Re: record as a number of lines


From: Ole Tange
Subject: Re: record as a number of lines
Date: Wed, 23 Nov 2011 23:32:22 +0100

On Wed, Nov 23, 2011 at 9:59 PM, Cook, Malcolm <address@hidden> wrote:

> Also, I've wanted to be able to define blocks in terms of number of lines.  
> For instance, fastq format has new record every 4 lines.  Is there a way to 
> block on line number. (candidate blocks are where the line number is 
> divisible by 4).

So what you want is to define a record as a 4 line record. It could be
something like:

  --record 4l # 4lines
  --record 4 # 4bytes
  --record 4k # 4000bytes
  --record 4kl # 4000lines

Try this for now:

cat big | perl -pe '($.-1)%4 or print "SePaRaToR"' | parallel --pipe
--recstart SePaRaToR --rrs do_stuff

Performancewise it will be very similar if implemented. Is that fast enough?


/Ole



reply via email to

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