You should probably consider using printf. You may need to scan all of your files first to determine maximum column widths.
knoppix@Microknoppix:~/data$ perl -E ' > open my $inFH, q{<}, \ <<EOD or die $!; > 01-16A1-325 01-16A1-325 01-16A1-325 01-16A1-325 > 01-16A1-325 01-16A1-325 01-16A1-325 01-16A1-325 > A T G C > 11 47 0 1 > 11 47 0 0 > 11 48 0 0 > EOD > > while ( <$inFH> ) > { > printf qq{%15s%15s%15s%15s\n}, split; > }' 01-16A1-325 01-16A1-325 01-16A1-325 01-16A1-325 01-16A1-325 01-16A1-325 01-16A1-325 01-16A1-325 A T G C 11 47 0 1 11 47 0 0 11 48 0 0 knoppix@Microknoppix:~/data$
I hope this is helpful.
Cheers,
JohnGG
In reply to Re: filling up rows in files to make them of equal length
by johngg
in thread filling up rows in files to make them of equal length
by biobee07
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |