我有以下文本文件
<IPG>298,"2013-06-25 16:00","Modication"
<IIP>
13925,2,"ippico",2,2,"SGT","S.G.TEATINO TR/PM",2,8,0,"BELLO","BUONO"
<CR>
13925,10,"SGT",2,"SGT CORSA 2",2,9,9,5571141,0,1,"2013-06-25 16:00",10,13925010
<CV>
13925010,1,"HOLZ","A","A.STO","",1,20,1600,0,0,0,3,14,3,14,0,0
13925011,2,"BREED AND","A","G.PACI","",1,20,550,0,0,0,3,14,3,14,0,0
</CV>
</CR>
</IIP>
<GE>A,100,331,332,353,354,372,373
</GE>
<IPG>
我想将上述文件转换为适当的 XML 结构,将每个逗号分隔值(如您可以在标签内看到的 csv)视为一个 XML 节点或属性。
例如,
<IPG>
标签应该是
<IPG id="298" date="2013-06-25 16:00" desc="Medication">
对于<CV>
标签,标签下的每一行都应该是一个单独的节点,例如
<CV id="13925010" Status="1" ......../>
<CV id="13925011" Status="2"........./>
知道如何使用 c# 4.0 实现这一点。
提前致谢。