So, I need help trying to parse an XML response in Bash. Let's say my response is this. (The response is abridged, but only shows the info I need.)
<?xml version="1.0" encoding="UTF-8"?>
<response>
<submissions>
<submission>
<submission_id><![CDATA[90210]]></submission_id>
<last_file_update_datetime><![CDATA[2017-06-18 02:47:14.39864+02]]></last_file_update_datetime>
</submission>
<submission>
<submission_id><![CDATA[90211]]></submission_id>
<last_file_update_datetime><![CDATA[2017-06-11 15:48:04.279135+02]]></last_file_update_datetime>
</submission>
</submissions>
</response>
I want to parse for each block in <submissions>
, and export the data into an array in this format:
{submission_id}#{last_file_update_datetime}#1
As an example, the response should look like this when parsed:
90210#2017-06-18 02:47:14.39864+02#1
90211#2017-06-11 15:48:04.279135+02#1
How can I perform this in Bash?