burnettben
Programmer
I am trying to assign a variable the value of a field.
I tried to use:
awk 'BEGIN{name="";} { print $3;
name=$3;
print $name; }' file
but what it outputs is the correct field for first print ($3) but then when i assign and then print it assigns the whole line, i am really confused!!!
Anyone got any suggestions!!
Ben
I tried to use:
awk 'BEGIN{name="";} { print $3;
name=$3;
print $name; }' file
but what it outputs is the correct field for first print ($3) but then when i assign and then print it assigns the whole line, i am really confused!!!
Anyone got any suggestions!!
Ben