Quote:
Originally Posted by
rubin
AFAIK the problem lies in using single quotes in the second awk command. You are running a nested awk, so using single quotes again will confuse the initial outer awk script, (I ran into the same problem before).
So I'd suggest try to avoid the single quotes and use the other methods shown here to assign the variables.
Hope it helps.
Hey,
Could you please tell me, how to get a particular cell value using awk.
As far as I know, awk works on records.,
As :
--------------------------------------
mqsiaaa 123 888
mqsiddd 456 999
t2589gg 789 555
-------------------------------------
In the above table, say i search using $2 column and i want to get the value of $3 of that searched record.
awk '$2~/456/ { printf $3 > "filefilter"}' temp.txt
Means I want the 999 only corrosponding to the search, but as awk works on records and $3 represent whole third column, it used to give me
888
999
555
all the three values in filefilter., BUT i want only 999 (respective to the matched record and its 3rd cell value.)
How to achieve that ??
Do let me know.
Thanks in advance.
Varun.
