I have a file f1.txt which has contents like belowfile1 file2file3 file4and file1 has contents like belowstudent1 10student2 20Now I want to get the first column from f1.txt and print out contents of file1 using awk.I tried awk '{print $1}' f1.txt | cat $1, but it doesn't work.Any simple way to get the contents of file1 using awk?
AWK - how to get contents of a file pointed by first column of a file
awk
Within awk you can call function system to run external command:awk '{system(cat $1)}' f1.txtOr if you want to print only content of the file1 and not file3:awk 'NR==1{system(cat $1)}' f1.txt