Article 5NXPQ output lines in place of columns

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?latest?d=yIl2AUoC8zA latest?i=6UxOPYGw0q4:YSfZkliX1iM:F7zBnMy latest?i=6UxOPYGw0q4:YSfZkliX1iM:V_sGLiP latest?d=qj6IDK7rITs latest?i=6UxOPYGw0q4:YSfZkliX1iM:gIN9vFw6UxOPYGw0q4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments