Formatting XML file

derpaderpa

New Member
Original Data :\[code\]<?xml version="1.0"?><CascadedExtractFileData><Country><IsoCountryCode>IN</IsoCountryCode><Provider><ItuCode>CASCADED_PROV</ItuCode><AccessInterconnect><CASCADED_INTERCONNECT_ID>50</CASCADED_INTERCONNECT_ID><TailTechnology><CASCADED_ACCESS_METHOD_ID>1</CASCADED_ACCESS_METHOD_ID></TailTechnology></AccessInterconnect></Provider></Country></CascadedExtractFileData>\[/code\]Required Like:\[code\]<?xml version="1.0"?><CascadedExtractFileData><Country><IsoCountryCode>IN</IsoCountryCode><Provider><ItuCode>CASCADED_PROV</ItuCode><AccessInterconnect><CASCADED_INTERCONNECT_ID>50</CASCADED_INTERCONNECT_ID><TailTechnology><CASCADED_ACCESS_METHOD_ID>1</CASCADED_ACCESS_METHOD_ID></TailTechnology></AccessInterconnect></Provider></Country></CascadedExtractFileData>\[/code\]I need each tag \[code\]<>\[/code\] and \[code\]</>\[/code\] on a new line and data in between \[code\]<>IN</>\[/code\] e.g. \[code\]IN\[/code\] also on a new line. I need a perfectly structured XML format.I need a solution using Unix tools: \[code\]grep\[/code\], \[code\]sed\[/code\] or \[code\]awk\[/code\].
 
Back
Top