bat 批处理 xml文件, 提取每一行指定内容到txt中。 10
<?xmlversion="1.0"?><Favorites><EntryIndex="2147483647"LibID="118">bravo</Entry><Entr...
<?xml version="1.0"?>
<Favorites>
<Entry Index="2147483647" LibID="118">bravo</Entry>
<Entry Index="2147483647" LibID="118">composite</Entry>
<Entry Index="2147483647" LibID="118">cursive</Entry>
<Entry Index="2147483647" LibID="118">ephemeris</Entry>
<Entry Index="2147483647" LibID="118">lateral</Entry>
<Entry Index="2147483647" LibID="118">lumped</Entry>
<Entry Index="2147483647" LibID="118">manipulation</Entry>
<Entry Index="2147483647" LibID="118">nude</Entry>
<Entry Index="2147483647" LibID="118">punctuation</Entry>
<Entry Index="2147483647" LibID="118">shrewd</Entry>
<Entry Index="2147483647" LibID="118">stringent</Entry>
<Entry Index="2147483647" LibID="118">transcript</Entry>
</Favorites>
把上述xml中的提取到txt中,保存格式为
bravo
composite
....
stringent
transcript
谢谢! 展开
<Favorites>
<Entry Index="2147483647" LibID="118">bravo</Entry>
<Entry Index="2147483647" LibID="118">composite</Entry>
<Entry Index="2147483647" LibID="118">cursive</Entry>
<Entry Index="2147483647" LibID="118">ephemeris</Entry>
<Entry Index="2147483647" LibID="118">lateral</Entry>
<Entry Index="2147483647" LibID="118">lumped</Entry>
<Entry Index="2147483647" LibID="118">manipulation</Entry>
<Entry Index="2147483647" LibID="118">nude</Entry>
<Entry Index="2147483647" LibID="118">punctuation</Entry>
<Entry Index="2147483647" LibID="118">shrewd</Entry>
<Entry Index="2147483647" LibID="118">stringent</Entry>
<Entry Index="2147483647" LibID="118">transcript</Entry>
</Favorites>
把上述xml中的提取到txt中,保存格式为
bravo
composite
....
stringent
transcript
谢谢! 展开
1个回答
展开全部
加在每个TXT开头: @echo off set "txt=D:\123.txt" for /r %%i in (*.txt) do ( type "%txt%">"%%~i.tmp" echo;>>"%%~i.tmp" type "%%~i">>"%%~i.tmp" move "%%~i.tmp" "%%~i") pause 加在结尾: @echo off set "txt=D:\123.txt" for /r %%i in (*.txt) do ( type "%%~i">"%%~i.tmp" echo;>>"%%~i.tmp" type "%txt%">>"%%~i.tmp" move "%%~i.tmp" "%%~i") pause 批处理放在需要的硬盘分区下运行,对所在目录及其子目录有效,加在中间某行的有点麻烦。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询