|
From: | Coby Viner |
Subject: | Use of --colsep without --header for multiple input files |
Date: | Fri, 30 Jun 2017 19:56:08 -0400 |
User-agent: | SquirrelMail/1.4.23 [SVN] |
Dear GNU Parallel readers,
Is it possible to use --colsep with multiple input files, without having to manually prefix each files' header by a unique identifier for use in conjunction with --header?
For example, it would be nice if with multiple files they could be automatically labelled with a–z, with numerals still referring to their columns (the reverse strikes me as better, but that would be counter-intuitive given the present implementation).
Currently, the following works well (I am using the latest version of GNU Parallel, 20170622, on Linux 2.6.32-642.6.2.el6.x86_64):
parallel --header --colsep "echo f1={f1} f2={f2} g1={g1} g2={g2}" :::: <(perl -e 'printf "f1\tf2\nA\tB\nC\tD\n"') :::: <(perl -e 'printf "g1\tg2\nE\tF\nG\tH\n"')
f1=A f2=B g1=E g2=F
f1=A f2=B g1=G g2=H
f1=C f2=D g1=E g2=F
f1=C f2=D g1=G g2=H
I would ideally like to be able to do the following:
parallel --colsep "echo f1={a1} f2={a2} g1={b1} g2={b2}" :::: <(perl -e 'printf "f1\tf2\nA\tB\nC\tD\n"') :::: <(perl -e 'printf "g1\tg2\nE\tF\nG\tH\n"')
Currently, the use of --colsep without --header for multiple files does not behave as I would have expected:
parallel --colsep '\t' "echo f1={1} f2={2}
g1={1} g2={2}" :::: <(perl -e 'printf
"f1\tf2\nA\tB\nC\tD\n"') :::: <(perl -e 'printf
"g1\tg2\nE\tF\nG\tH\n"')
f1=f1 f2=f2 g1=f1 g2=f2
f1=f1 f2=f2 g1=f1 g2=f2
f1=f1 f2=f2 g1=f1 g2=f2
f1=A f2=B g1=A g2=B
f1=A f2=B g1=A g2=B
f1=A f2=B g1=A g2=B
f1=C f2=D g1=C g2=D
f1=C f2=D g1=C g2=D
f1=C f2=D g1=C g2=D
It would be great to discuss possible ways of achieving something like this. My main use-case is to allow GNU Parallel to be used for complex self-joins, for which its convenient Perl regex abilities and overall syntax are especially handy. It would be particularly nice if replacement strings beyond {} could still fully-supported when only using --colsep in the above fashion.
Thank you for your consideration,
Coby Viner
[Prev in Thread] | Current Thread | [Next in Thread] |