Printing multiple columns from a file

Hi,
I need just to print the values of second and fourth column from a file

# cat dispaly
id Name Std Specialist
1  sss  X   mathematics
2  uyt  IX  geography
3  vcd  X   English

i tried with some NF command.. I think am wrong.. Is there anyother way to print my requirement

Why go for NF when you have the columns fixed??

awk '{ print $2, $4}' file
1 Like

It worked.. Thanks :wink:

From next time, please show us what you tried too :slight_smile: