我有一个<Amt Ccy="EUR">3.1</Amt Ccy="EUR">
标签重复的 XML。这(Ccy 可能会有所不同)在另一个标签下<Main>
。我需要对仅使用 awk 和/或 sed 命令的所有值求和<Amt Ccy="EUR">
(Ccy 可能会有所不同) 。<Main>
可以帮忙吗?
示例如下所示
<root>
<Main>
<someothertag>..</someothertag>
<Amt Ccy="EUR">3.1</Amt>
</Main>
.
.
.
some other tags
<Main>
<someothertag>..</someothertag>
<Amt Ccy="SGD">51</Amt>
</Main>
<another>
<Amt Ccy="EUR">10</Amt>
</another>
</root>