output lines in place of columns
by Drosera_capensis from LinuxQuestions.org on (#5NXPQ)
Hello everyone,
I want to output data in row rather than in column after having selected a pattern from a list with awk. But the command output truncated data,
The original file:
Code:head -3 file.txt
Scaffolds_16_pilon ACmerged_contig_806 5_1009.75816
Scaffolds_16_pilon ACmerged_contig_806 11_1010
Scaffolds_16_pilon ACmerged_contig_806 11_1011An attempt to output the data in row using a loop with list of the header:
Code:cat list.txt | while read line ;
do
awk /"$line"/'{print $3}' file.txt | tr "\n" "\t" ;
echo " " ;
doneCode:5_1009.7 1_1011It seems that the outputs are mixed up and truncated.
Would anyone know how to avoid it?
I want to output data in row rather than in column after having selected a pattern from a list with awk. But the command output truncated data,
The original file:
Code:head -3 file.txt
Scaffolds_16_pilon ACmerged_contig_806 5_1009.75816
Scaffolds_16_pilon ACmerged_contig_806 11_1010
Scaffolds_16_pilon ACmerged_contig_806 11_1011An attempt to output the data in row using a loop with list of the header:
Code:cat list.txt | while read line ;
do
awk /"$line"/'{print $3}' file.txt | tr "\n" "\t" ;
echo " " ;
doneCode:5_1009.7 1_1011It seems that the outputs are mixed up and truncated.
Would anyone know how to avoid it?