回复 1# tangtianhao
新手随便贴个,发现<enclosure>只出现了一次,就从它下手。- @echo off
- setlocal EnableDelayedExpansion
-
- for /f "delims=:" %%i in ('findstr /n "<enclosure>" test.xml') do set aa=%%i
-
- set /a aa-=1
- set bb=1
-
- for /f "delims=" %%i in (test.xml) do (
- if !bb! == %aa% set cc=%%i
- set /a bb+=1
- )
-
- set cc="%cc:*<description>=%"
- set cc="%cc:</description>=%"
- set cc=%cc:~2,-2%
- set cc=%cc:/= %
- echo %cc%
- pause
复制代码
|