Delete last comma from xml file using shell xmlstarlet



I've got comp.xml file which contains



<project name="installer" >
<property name="workflow.list" >
BTCH.WF_BatchRequest_Process.BatchRating,
BTCH.WF_BatchRequest_Process.Invoice,
</property>
<property name="wfGroup.list" >
BTCH.WFG_BatchResPrep,
BTCH.WFG_BatchRes,
</property>
<target name="shutdown">
<echo>shutdown</echo>
</target>
</project>


I need to delete last ',' comma in each <property> tag using shell if that comma exists So it should be:



<project name="installer" >
<property name="workflow.list" >
BTCH.WF_BatchRequest_Process.BatchRating,
BTCH.WF_BatchRequest_Process.Invoice
</property>
<property name="wfGroup.list" >
BTCH.WFG_BatchResPrep,
BTCH.WFG_BatchRes
</property>
<target name="shutdown">
<echo>shutdown</echo>
</target>
</project>

No comments:

Post a Comment