awk command for printing all the repeated matching lines without making them unique
I have two files file1 file2 which has taxonomy details .
for example
file1 : ( it has taxonomy ID – some digit)
9
9
4
4
4
file2 : ( it has other taxonomy details along with taxonomy ID )
9 A B C D
4 P Q R S
I want to get an output like
output :
9 A B C D
9 A B C D
4 P Q R S
4 P Q R S
4 P Q R S
I tried using this command
awk -F ‘t’ ‘NR==FNR{a[$1];next} ($1) in a’ file1 file2
• 65 views
Read more here: Source link