5
1
Is there a way to break an Excel column containing XML into several columns like this:
BEFORE
| Apples | Pears | XML |
| ------ | ----- | ---------------------------------|
| 35 | 18 | <Plums>34</Plums><Figs>19</Figs> |
| 86 | 55 | <Plums>12</Plums><Figs>62</Figs> |
| 99 | 12 | <Plums>18</Plums><Figs>23</Figs> |
AFTER
| Apples | Pears | Plums | Figs |
| ------ | ----- | ----- | ---- |
| 35 | 18 | 34 | 19 |
| 86 | 55 | 12 | 62 |
| 99 | 12 | 18 | 23 |
The original table comes from an SQL Server that stores XML in a text column. If the XML column contained comma-separated values, I'd tell Excel to do Text to Columns. Is there a similar feature for XML?
Thank you pnuts and James. Your solutions might work, but they are based on treating the XML code as a string, not as a logical structure. Since Excel is XML-aware, I thought there was a more elegant solution. And no, constant width is not guaranteed. – Mihai Nagy – 2013-04-30T18:58:52.780