확실한 이유는 환경 변수에 저장하지 마라. 그래서 이런 식으로 시도하십시오 : HTML 또는 ASP 파일을 분리하여 변수 배열에 저장합니다. 다시 배열하는 방법을 보여 줬습니다. 이것이 귀하를위한 해결책 인 경우 알려주십시오
@echo off
setlocal EnableDelayedExpansion EnableExtensions
echo.
set count=0
if exist newfile.html del newfile.html
:: to unassemble
for /f "tokens=*" %%a in (filename.html) do (
echo %%a
set /a count=count + 1
set htmllinenum!count!=%%a
)& set finalcount=!count!
:: to assemble
for /l %%a in (1,1,%finalcount%) do (
echo !htmllinenum%%a!>>newfile.html
)
notepad newfile.tmp
set count=0
if exist newfile.asp del newfile.asp
:: to unassemble
for /f "tokens=*" %%a in (filename.asp) do (
echo %%a
set /a count=count + 1
set asplinenum!count!=%%a
)& set finalcount=!count!
:: to assemble
for /l %%a in (1,1,%finalcount%) do (
echo !asplinenum%%a!>>newfile.asp
)
notepad newfile.asp
발견 한 html 파일을 읽고 싶습니까? – Ste
나는 이해하지 못한다. 당신은 디렉토리에있는 모든 파일을 찾고 문자열 객체에 지정된 파일을로드하고 싶습니까? – zgnilec
그것은 본질적으로 그것입니다. 디렉토리의 모든 파일을 찾아서 문자열로 읽은 다음 내 기준에 맞는 이미지 태그의 문자열을 확인하고 싶습니다. 디렉토리 부분과 이미지 태그 검색 부분이 더 많거나 적게 있습니다. 내용을 .txt 파일로 먼저 복사하지 않고 문자열로 파일을 읽을 수 있습니까? – MNRSullivan