本帖最后由 zhengwei007 于 2024-11-21 21:19 编辑
我有N个XML碎文件,文件名各式各样,但无所谓,我希望把这些文件内容全部整理到一个csv中,我就挑几个例子展示,大概样式如下:复制代码 通过批处理输出结果如下:- id,type,name,icon,bodypart,armor_type,weight,soulshots,spiritshots,crystal_type,p_dam,rnd_dam,weapon_type,critical,hit_modify,atk_speed,m_dam,price,sellable,dropable,tradeable,pAtk,mAtk,rCrit,accCombat,pAtkSpd,pAtk,mAtk,pDef
- 1,Weapon,Short Sword,icon.weapon_small_sword_i00,rhand,,1600,1,1,none,8,10,sword,8,,379,6,768,,,,8,6,8,0,379,0,0,
- 2,Weapon,Long Sword,icon.weapon_long_sword_i00,rhand,,1560,2,2,none,24,10,sword,8,,379,17,136000,,,,24,17,8,0,379,0,0,
- 6,Weapon,Apprentice's Wand,icon.weapon_apprentices_wand_i00,rhand,,1350,1,1,none,5,20,blunt,4,4,379,7,138,FALSE,FALSE,FALSE,5,7,4,4,379,0,0,
- 99,Weapon,Apprentice's Spellbook,icon.weapon_apprentices_spellbook_i00,rhand,,650,1,1,none,9,10,etc,8,,379,12,12500,,,,9,12,8,0,379,0,0,
- 9208,Armor,Phantom Mask (Event),icon.accessary_mask_of_chaotic_i00,dhair,none,10,,,none,,,,,,,,,FALSE,FALSE,FALSE,,,,,,,,0
复制代码 里面遇到新的字段时,直接增加到列标题上,没有该数据的,值为空。
每个[item]为一段,for里面是把后面的做为标题,前面的val才是值。
不知有没有大佬帮忙看看好不好做这个批处理。先谢谢各位! |