힘든, schmuff. 오래된 배치를 재활용하면됩니다.
데이터 형식에 따라 달라 지지만 샘플을 제공하지 않았습니다. q23655846.txt
<root>
<cities>
<cityName>paris</cityName>
<cityName>london</cityName>
<cityName>...</cityName>
...
</cities>
<countries>
<countryName>india</countryName>
<countryName>japon</countryName>
<countryName>...</countryName>
...
</countries>
<continents>
<continentName>asia</continentName>
<continentName>america</continentName>
<continentName>South america</continentName>
<continentName>...</continentName>
...
</continents>
</root>
수정 된 코드
Here's one I solved earlier
샘플 데이터에 맞게 '자신의 file` 요구 사항의 각 :
@ECHO OFF
SETLOCAL
SET "outloc=U:\destdir\file_"
set "tag=continentName"
set "f_xml=q23655846.txt"
set "tag2=/%tag%"
setlocal enabledelayedexpansion enableextensions
set fcnt=0
for /f "tokens=2-4delims=<>" %%a in (%f_xml%) do (
IF "%%a"=="%tag%" IF "%%c"=="%tag2%" SET /a fcnt+=1&>>"%outloc%!fcnt!" ECHO(%%b
)
GOTO :eof
I가 떠날거야 outloc
의 설정 당신 - 게시 한 위치가 내 시스템에 편리합니다. 태그와 xml 파일명에 따릅니다.
블록을 출력하거나 절대 소스 파일 이름에 공백과 같은 분리 기호가 포함 된 경우에는 약간의 변경이 필요합니다.
이것은 배치 파일에서 거친 말입니다. –