나는 일반적으로 다른 사람들이 표현한 정서에 동의합니다. 배치는 텍스트 처리가 어렵습니다. 다른 언어 나 도구를 사용하는 것이 좋은 생각입니다.
그러나 단순히 각 html://
전에 줄 바꿈 삽입
:-) 일괄 수행 할 수 있습니다 그렇게 어려운 일이 아니다
@echo off
setlocal disableDelayedExpansion
:: The first FOR loop loads a quoted linefeed into %%L
:: The blank line within the IN() clause is critical. Do not remove.
for %%L in (^"^
^") do (
for /d %%A in ("C:\Documents and Settings\*") do (
for /f "eol=: delims=" %%B in (
'findstr /S "http://" "%%A\Application Data\Sun\Java\Deployment\cache\6.0\*"'
) do (
set "line=%%B"
setlocal enableDelayedExpansion
echo(!line:http://=%%~Lhttp://!
endlocal
)
)
) >c:\temp\javaurls.txt
그러나 http://
로 시작하며 이름을 유지에만 결과 라인을 유지 주소가 진짜 고통이되기 전에 각 파일의.
@echo off
setlocal disableDelayedExpansion
:: The first FOR loop loads a quoted linefeed into %%L
:: The blank line within the IN() clause is critical. Do not remove.
for %%L in (^"^
^") do (
for /d %%A in ("C:\Documents and Settings\*") do (
for /f "tokens=1* delims=:" %%B in (
'findstr /S "http://" "%%A\Application Data\Sun\Java\Deployment\cache\6.0\*"'
) do (
set "line=%%C"
setlocal enableDelayedExpansion
set "line=!line:http://=%%~Lhttp://!"
for /f "delims=" %%D in (
'"cmd /v:on /c echo(^!line^!|findstr http://"'
) do (
if "!!" equ "" endlocal
echo %%B: %%D
)
)
)
) >c:\temp\javaurls.txt
exit /b
Perl이나 Grep을 설치하고 사용합니다. 고통을 즐기지 않는 한. – dan1111
@AndyG Perl을 설치하지 않으려면 대신 [Sed] (http://www.grymoire.com/Unix/Sed.html)를 사용할 수 있습니다. regexp 기반 검색/교체 작업을위한 훌륭한 명령 줄 도구입니다. [Here] (http://gnuwin32.sourceforge.net/packages/sed.htm)에서는 Windows 용 무료 버전을 다운로드 할 수 있으며 dan1111의 regexp 문자열 만 사용할 수 있습니다. 결과는 동일합니다. –