parallel: --header will now parse the first line and you can use column names as {colname}. Experimental => man missing.

This commit is contained in:
Ole Tange 2012-01-07 04:22:48 +01:00
parent 8c4b0ba4b9
commit 92d7c462e7
3 changed files with 3 additions and 3 deletions

View file

@ -83,7 +83,7 @@ if($::opt_header) {
::debug("Delimiter: '$delimiter'");
for my $s (split /$delimiter/o, $line) {
::debug("Colname: '$s'");
$command =~ s/\{$s\}/\{$id\}/g;
$command =~ s:\{$s(|/|//|\.|/\.)\}:\{$id$1\}:g;
$id++;
}
}

View file

@ -25,7 +25,7 @@ echo '### Test --resume --joblog followed by --resume --joblog';
cat /tmp/joblog2 | wc;
rm -f /tmp/joblog2;
echo '### Test --header';
printf "a\tb\n1\t2" | parallel --header echo {b} {a}
printf "a\tb\n1.2\t3/4.5" | parallel --header echo {b} {a} {b.} {b/} {b//} {b/.};
EOF
echo '### Test --shellquote'

View file

@ -31,7 +31,7 @@ parallel: -H has been retired. Use --halt.
### Test --resume --joblog followed by --resume --joblog
5 49 205
### Test --header
2 1
3/4.5 1.2 3/4 4.5 3 4
### Test --shellquote
awk\ -v\ FS=\"\\\",\\\"\"\ \'\{print\ \$1,\ \$3,\ \$4,\ \$5,\ \$9,\ \$14\}\'\ \|\ grep\ -v\ \"\#\"\ \|\ sed\ -e\ \'1d\'\ -e\ \'s/\\\"//g\'\ -e\ \'s/\\/\\/\\//\\t/g\'\ \|\ cut\ -f1-6,11\ \|\ sed\ -e\ \'s/\\/\\//\\t/g\'\ -e\ \'s/\ /\\t/g
### Test make .deb package