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: Sat, 7 Jan 2012 04:25:54 +0100

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}
:
>
> Maintainability of code that deals with database dumps where the
> column orderings could be altered (such as adding a single new field)
> is a good and common example. Instead of relying on column order you
> can refer to each field by its label, this is also a lot more readable
> too.

--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.


/Ole



reply via email to

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