field: Use \t as separator.

This commit is contained in:
Ole Tange 2020-10-11 12:40:12 +02:00
parent 30f10bbdf1
commit 157e498d6b

View file

@ -101,7 +101,7 @@ if($Global::must_eval) {
$Calc::f{$#F}++;
@{$Calc::fields->{$#F}} = eval $fields;
}
print join(" ",@F[@{$Calc::fields->{$#F}}]),"\n";
print join("\t",@F[@{$Calc::fields->{$#F}}]),"\n";
}
} else {
# awk counts from 1 not 0
@ -109,7 +109,7 @@ if($Global::must_eval) {
# Use mawk (60 MB/s)/gawk (30 MB/s)/awk (? MB/s)
my $awk = which("mawk") || which("gawk") || which("awk");
my $awkscript = '{print '.
my $awkscript = 'BEGIN {OFS = "\t"} {print '.
(join ",", map { '$'.$_ } @fields).
'}';
exec($awk,$awkscript);