
【已解決】求助批處理從一堆文本文件中提取關鍵詞寫到csv最后由 zhengwei007 于 -2-27 13:25我想從100多個文檔里面,發現有Soul Crystal字符時,截取<item>這段內容的字段。字段包括每個ID和count數量,單獨存放在csv文件里。文檔中是以<item>開頭,</item>結尾的,謝謝大家。由于不能上傳附件,我粘點里面內容吧。
每個文件里可能有多個這樣的內容結構。最終csv就是這樣:721463412131975729100046811109551573390000213233946611109581219661957112134285219691謝謝各位大哥。nclick="copycode($('code0'));">復制代碼
- <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>
- <!-- Guardian Sword - Great Gale -->
- <ingredient count=1 id=10955 />
- <!-- Adena -->
- <ingredient count=3390000 id=57 />
- <!-- Gemstone B -->
- <ingredient count=339 id=2132 />
- <!-- Blue Soul Crystal - Stage 10 -->
- <ingredient count=1 id=4661 />
- <!-- Guardian Sword - Great Gale - Critical Bleed -->
- <production count=1 id=10958 />
- </item>
- <item>
- <!-- Blood Brother - Great Gale -->
- <ingredient count=1 id=21966 />
- <!-- Blue Soul Crystal - Stage 14 -->
- <ingredient count=1 id=9571 />
- <!-- Gemstone S -->
- <ingredient count=285 id=2134 />
- <!-- Blood Brother - Great Gale - Light -->
- <production count=1 id=21969 />
- </item>

