3
일괄 처리에서 특수 문자가있는 파일을 읽고 구문 분석하려면 어떻게해야합니까? 나는이 그냥 foo!!!bar
에있는 test.txt라는 텍스트 파일 및 배치 파일이 : 내가 원하는 그것은 어떻게 든 출력 foo!!!bar
에 기대일괄 처리에서 특수 문자가있는 파일 읽기
@echo off
setlocal enabledelayedexpansion enableextensions
FOR /F "tokens=* delims=" %%a IN (.\test.txt) DO (
echo Unquoted is %%a
echo Quoted is "%%a"
set "myVar=%%a"
echo myVar is still !myVar! or "!myVar!"
)
exit /b 0
을하지만,이 출력 : 코스 I의
Unquoted is foobar
Quoted is "foobar"
myVar is still foobar or "foobar"
그냥 type test.txt
일 수는 있지만 파일의 각 줄을 처리하고 싶습니다.
볼 수 있었다 – CIPHER