Hello all,
I have two files, vfile, venv,
cat vfile
file1 v_name1 v_name2 v_name3 na v_name5 na v_name7
file2 v_name1 na v_name3 na v_name5 v_name6 na
file3 v_name1 v_name2 na na na na na
cat venv
v_name1=v1
v_name2=v2
v_name3=v3
v_name4=v4
v_name5=v5
v_name6=v6
v_name7=v7
want to use awk to go through each record in vfile
for (i=2; i<=NF; ++i)
if ( $i !~ /^na$/ )
want to obtain the result of (e.g. for 1st record)
result = grep $v_name1 file1 | wc -l
it's actually 'grep v1 file1 | wc -l'
if (result = 2)
pass
else
fail
please see if you could provide a start point. I don't have deep understand of awk, so messed up a little bit.
Thanks!
I have two files, vfile, venv,
cat vfile
file1 v_name1 v_name2 v_name3 na v_name5 na v_name7
file2 v_name1 na v_name3 na v_name5 v_name6 na
file3 v_name1 v_name2 na na na na na
cat venv
v_name1=v1
v_name2=v2
v_name3=v3
v_name4=v4
v_name5=v5
v_name6=v6
v_name7=v7
want to use awk to go through each record in vfile
for (i=2; i<=NF; ++i)
if ( $i !~ /^na$/ )
want to obtain the result of (e.g. for 1st record)
result = grep $v_name1 file1 | wc -l
it's actually 'grep v1 file1 | wc -l'
if (result = 2)
pass
else
fail
please see if you could provide a start point. I don't have deep understand of awk, so messed up a little bit.
Thanks!