Hi
I have a file which contains count for a code. Code is first field and count is second field.
I am trying to search the code and get correspond count.
File look like this. temp.out
A 10
B 20
I am searching for C , if C is not there I will have get value 0.
I have written like this to get the count.
c=`grep "C " temp.out | awk '{print $2}'`
But this c is getting a null. How do I change it so that I will get zero instead of null.
Thanks for the reply. I understand if it does not find , I will replace with Zero.
But if the C is present , it has to print from the file for second field.
The above solution does not work.
I tried both .