Hi
i have a file vv whose contents are below
<entries xmi:id="VariableSubstitutionEntry_29" symbolicName="UNIVERSAL_JDBC_DRIVER_PATH" value="${WAS_INSTALL_ROOT}/universalDriver/lib" description="The directory that contains the DB2 Universal JDBC driver license file."/>
I need to extract the symbolicname value and value of value from this line and print it
The result that i want is UNIVERSAL_JDBC_DRIVER_PATH=${WAS_INSTALL_ROOT}/universalDriver/lib
Here is the script i have but donno how to map the 2 variables var1 and var2 to form the above . nay help is greatly appreciated
=========Code=========
while read line
do
echo $line |awk ' BEGIN { FS = "\" "} {split($0,nav,"\" ");
for ( x = 1 ; x <= NF ; ++x )
#{print nav[x] }
{ split(nav[x],opt,"=\"") ;
if ( opt[1] == "symbolicName") {var1=opt[2] ;print var1 }
if ( opt[1] == "value") {var2=opt[2] ; print var2 }
}
} '
done < vv
====================End code=========
========Result ======================
UNIVERSAL_JDBC_DRIVER_PATH
WAS_INSTALL_ROOT/universalDriver/lib
===================================================
cheers
Naveen
i have a file vv whose contents are below
<entries xmi:id="VariableSubstitutionEntry_29" symbolicName="UNIVERSAL_JDBC_DRIVER_PATH" value="${WAS_INSTALL_ROOT}/universalDriver/lib" description="The directory that contains the DB2 Universal JDBC driver license file."/>
I need to extract the symbolicname value and value of value from this line and print it
The result that i want is UNIVERSAL_JDBC_DRIVER_PATH=${WAS_INSTALL_ROOT}/universalDriver/lib
Here is the script i have but donno how to map the 2 variables var1 and var2 to form the above . nay help is greatly appreciated
=========Code=========
while read line
do
echo $line |awk ' BEGIN { FS = "\" "} {split($0,nav,"\" ");
for ( x = 1 ; x <= NF ; ++x )
#{print nav[x] }
{ split(nav[x],opt,"=\"") ;
if ( opt[1] == "symbolicName") {var1=opt[2] ;print var1 }
if ( opt[1] == "value") {var2=opt[2] ; print var2 }
}
} '
done < vv
====================End code=========
========Result ======================
UNIVERSAL_JDBC_DRIVER_PATH
WAS_INSTALL_ROOT/universalDriver/lib
===================================================
cheers
Naveen