0

I have one really big file xml. The stucture is like this:

<channel update="i" site="merge-xmltv" site_id="" xmltv_id="Rai 1">Rai 1</channel>
<channel update="i" site="merge-xmltv" site_id="" xmltv_id="Rai 1 +2HD">Rai 1 +2HD</channel>
<channel update="i" site="merge-xmltv" site_id="" xmltv_id="Rai 1 +1HD">Rai 1 +1HD</channel>

I want synk the field "site_id" with the field "xmltv_id" I need something like this:

<channel update="i" site="merge-xmltv" site_id="Rai 1" xmltv_id="Rai 1">Rai 1</channel>
<channel update="i" site="merge-xmltv" site_id="Rai 1 +2HD" xmltv_id="Rai 1 +2HD">Rai 1 +2HD</channel>
<channel update="i" site="merge-xmltv" site_id=""Rai 1 +1HD" xmltv_id="Rai 1 +1HD">Rai 1 +1HD</channel>

I tried with the command

xml ed -u  "/channel/@site_id" -x "concat(/channel/@xmltv_id)" test.xml

but i think is really wrong :(

  • You should not cross-post like this. http://stackoverflow.com/questions/41850778/copy-data-inside-one-field-xml – Michael Vehrs Jan 26 '17 at 14:37
  • Is not cross-post, i am asking about a different solution and I have no idea to delete the previus post, if you can delete it, you are welcome if you can. – Tapiocapioca Jan 26 '17 at 19:06
  • Possible duplicate of [Copy data inside one field XML](http://stackoverflow.com/questions/41850778/copy-data-inside-one-field-xml) – npostavs Jan 27 '17 at 02:31

0 Answers0