parallel
[Top][All Lists]
Advanced

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

Re: ENHANCEMENT: using the header from a delimited file


From: Ole Tange
Subject: Re: ENHANCEMENT: using the header from a delimited file
Date: Wed, 11 Jan 2012 11:24:40 +0100

On Sat, Jan 7, 2012 at 4:25 AM, Ole Tange <tange@gnu.org> wrote:
> On Thu, Dec 29, 2011 at 9:47 PM, Matt Oates (Home) <mattoates@gmail.com> 
> wrote:
>> On 15 December 2011 21:36, Ole Tange <ole@tange.dk> wrote:
>>> As it is now, you can run:
>>>
>>>       parallel -a table_file.tsv --skip-first-line --colsep '\t' cmd
>>> -o {1} -i {2}
:
> --header will now parse the first line and you can use column names as 
> {colname}
>
> You can now do:
>
> printf "a\tb\n1.2\t3/4.5" | parallel --header echo {b} {a} {b.} {b/}
> {b//} {b/.};
>
> Please test it, but regard it as experimental and thus do not depend on it.

--header will be changed later today:

--header regexp
  Use upto regexp as header. For normal usage the matched header
(typically the first line: --header '\n') will be split using --colsep
(which will default to '\t') and column names can be used as
replacement variables: {colname}. For --pipe the matched header will
be prepended to each output.

Please test this and give feed back on that.


/Ole



reply via email to

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