本帖最后由 zhengwei007 于 2023-12-14 10:45 编辑
我想从100多个文档里面,发现有Soul Crystal字符时,截取下面一行的ID 4645,和最后一行的4682,单独存放在csv文件里。
文档中是以<item>开头,</item>结尾的,谢谢大家。
由于不能上传附件,我粘点里面内容吧。- <item>
- <!-- Stormbringer -->
- <ingredient count="1" id="72" />
- <!-- Red Soul Crystal - Stage 5 -->
- <ingredient count="1" id="4634" />
- <!-- Gemstone C -->
- <ingredient count="97" id="2131" />
- <!-- Adena -->
- <ingredient count="291000" id="57" />
- <!-- Stormbringer - Critical Anger -->
- <production count="1" id="4681" />
- </item>
- <item>
- <!-- Stormbringer -->
- <ingredient count="1" id="72" />
- <!-- Green Soul Crystal - Stage 5 -->
- <ingredient count="1" id="4645" />
- <!-- Gemstone C -->
- <ingredient count="97" id="2131" />
- <!-- Adena -->
- <ingredient count="291000" id="57" />
- <!-- Stormbringer - Focus -->
- <production count="1" id="4682" />
- </item>
复制代码 从这里提取4634和4681即可,每个文件里可能有多个这样的内容结构。
最终csv就是这样:
4634,4681
4645,4682
链接:https://pan.baidu.com/s/13ecRnqY4tPRaoFcVBEBLTg
提取码:xlit
这里存放了几个真实的文本文件的下载地址。 |