BEGIN{FS="\t";}
{
line[NR] = $0 # saves the line
for (f=1; f<=NF; f++) {
len = length($f)
if (len>max[f])
max[f] = len # an array of maximum field widths
}
}
END {
for(nr=1; nr<=NR; nr++) {
nf = split(line[nr], fields)
for (f=1; f
print fields[f] # the last field need not be padded
}
}
No comments:
Post a Comment