I have a txt file that contains the following lines
jfo3 93jfl
lvls 29fdj
nskd jfuwe
xlkw eklwe
I'm trying to read the file line by line, and do something with it. What delimiter should I use?
The delim I'm using here reads each word separately.
@echo off
setlocal EnableDelayedExpansion开发者_如何学编程
for /f "delims=" %%x in (lines.txt) do (
echo %%x
)
This reads line by line for me:
for /f "delims=" %x in (lines.txt) do echo %x
The problem is not related to delims, but to tokens:
for /f "tokens=*" %%x in (lines.txt) do echo %%x
If this is your input file:
abc,def
ghi,jkl
mno,pqr
then use
FOR /F "tokens=1,2,3 delims=," %%i in (test.txt) do (whatever u want)
精彩评论