Can any one tell me how to get the second last column value from the text file, which has different record size for each record.
I know how to get the last column using awk and print statements, but I am unable to get the second last column value from the file.
posix
2
awk 'NR==2{print $NF}' file_name
it show the 2nd columns last value.. sorry
awk '{x=NF-1;print $x}' filename
pludi
4
awk '{print $(NF-1)}' file
thanks to all of you, the 2nd & 3rd giving the correct output but the 1st one still gave the last column value.