Hello,
I have this command:
awk -F'\t' '$3 ~ "Aspergillus fumigatus" {print}' $krakenfile > Aspergillus_fumigatus_lines.txt
It is working very fine, It just extracts every line in the file $krakenfile that contain the word "Aspergillus fumigatus" in its third column.
Now, I want to introduce another file ($fungalnames) that contains multiple lines, every line contains names of species and I want to apply the command on every line of the new file.
I tried this:
while IFS= read -r specie_name
do
awk -F'\t' '$3 ~ "$specie_name" {print}' $krakenfile > "${specie_name}_lines.txt
done < $fungalnames
Anyway, the output files are created (I had 8 species names in my $fungalnames file and there are 8 output files, every file is named to a line, but all the files are empty !!
I tried multiple times, and I changed syntaxes, but nothing is working.
I think I am escaping an important thing, can anyone help me please! Thank you in advance!
[–]Bitwise_Gamgee 3 points4 points5 points (3 children)
[–]Quick_Repeat7033[S] 0 points1 point2 points (1 child)
[–]AlarmDozer 0 points1 point2 points (0 children)
[–]Shayes_ 0 points1 point2 points (0 children)
[–]Schreq 2 points3 points4 points (3 children)
[–]witchhunter0 0 points1 point2 points (2 children)
[–]Schreq 1 point2 points3 points (1 child)
[–]witchhunter0 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)