how to search with 2 strings.

Hi,
i have a file a.txt like
--------------------------------
col1|col2|col3
data1|data2|data3
other1|other2|other3
--------------------------------

i need to search 2 strings(data in a.txt file is case sesnsitive), suppose data1 and data2. If these 2 strings found then only i need to update data3 string with data4 string. If not found then i have to echo some message(No data found).

Pls provide me some solution for this.
Thanks in advance.

grep -E "data1|data2" a.txt
if [[ $? -eq 0 ]] ; then
  sed -e "s/\(data1|data2|\).*/\1data4/g" a.txt
else
  echo "No data1|data2 in a.txt"
fi
nawk '{
if (index($0,"data1")!=0 && index($0,"data2")!=0)
{
sub(/data3/,"data4",$0)
print
}
else
print
}' filename