[Solved] Select required field from line [closed]


Here you go:

awk '{a=$1;c=$4;getline;b=$3;getline;d=$4;print a,b,c,d}'
test 12 17 19

You does not say how to get the result!!!

awk '               # start 
    {
    a=$1            # from first line set a="test"
    c=$4            # from first line set c=17
    getline         # get next line
    b=$3            # from second line set b=12
    getline         # get next line
    d=$4            # from third line set d=19
    print a,b,c,d   # print this
    }' file

3

solved Select required field from line [closed]