Need your help in below getting java code for below requirement
I have a text file with the below details and we get the input as name CONNECTION_PORT and we need to delete the matching global variable which as CONNECTION_PORT and keep the remaining global variable in file without using any temp files. can you please help
for example
input:
CONNECTION_PORT
Text file
<globalVariable>
<name>CERTIFICATE_PASSWORD</name>
<value>fgfdgfgf</value>
<deploymentSettable>true</deploymentSettable>
<serviceSettable>false</serviceSettable>
<type>Password</type>
<modTime>1398834966045</modTime>
</globalVariable>
<globalVariable>
<name>CONNECTION_HOST</name>
<value>localhost</value>
<deploymentSettable>true</deploymentSettable>
<serviceSettable>false</serviceSettable>
<type>String</type>
<modTime>1398834966045</modTime>
</globalVariable>
<globalVariable>
<name>CONNECTION_PORT</name>
<value>7833</value>
<deploymentSettable>true</deploymentSettable>
<serviceSettable>false</serviceSettable>
<type>String</type>
<modTime>1398834966045</modTime>
</globalVariable>