#cat kv_file
********
********
name="hello"
version="RA01"
date="20081107"
********
********
name="world"
version="RA02"
date="20081108"
#awk 'BEGIN{nl=length("name=\"")+1;vl=length("version=\"")+1;}/name=/{key=substr($0, nl, length-nl);getline value;value=substr(value, vl, length(value)-vl); print key":"value | "tee " key }' kv_file
hello:RA01
world:RA02
awk -F'[="]+' '$1=="name"{key=$2;getline;print key":"$2}' kv_file
hello:RA01
world:RA02
|