how do i display empty lines with maybe DELIMS and TOKENS for TYPE command?
Posted: 02 Oct 2024 19:58
F9.TXT has
1
2
3
5
7
8
-------------------------------------------------------------
SET K1=F9.TXT
REM these two lines just below are not from me, you may ignore them, cause i dont understand ^ well
For /F tokens^=*^ delims^=^ eol^= %%I in ('TYPE "%K1%"') do echo. %%I
For /F tokens^=*^ delims^=^ eol^= %%I in ("C:\F9.TXT") do echo. %%I
REM --------------------------------------------------------
SetLocal EnableExtensions EnableDelayedExpansion
FOR /F "DELIMS=" %%V IN ('TYPE "%K1%"') DO (
SET VV=%%V
ECHO !VV!
)
ECHO.
FOR /F "Tokens=*" %%V IN ('TYPE "%K1%"') DO (
SET VV=%%V
ECHO !VV!
IF /I "!VV!"=="" ECHO.
IF /I "!VV:~0!"=="" ECHO.
PAUSE
but this batch displays
1
2
3
5
7
8
how do i make the empty lines as output as well as they were intended
all 4 for do loops do not display empty lines
1
2
3
5
7
8
-------------------------------------------------------------
SET K1=F9.TXT
REM these two lines just below are not from me, you may ignore them, cause i dont understand ^ well
For /F tokens^=*^ delims^=^ eol^= %%I in ('TYPE "%K1%"') do echo. %%I
For /F tokens^=*^ delims^=^ eol^= %%I in ("C:\F9.TXT") do echo. %%I
REM --------------------------------------------------------
SetLocal EnableExtensions EnableDelayedExpansion
FOR /F "DELIMS=" %%V IN ('TYPE "%K1%"') DO (
SET VV=%%V
ECHO !VV!
)
ECHO.
FOR /F "Tokens=*" %%V IN ('TYPE "%K1%"') DO (
SET VV=%%V
ECHO !VV!
IF /I "!VV!"=="" ECHO.
IF /I "!VV:~0!"=="" ECHO.
PAUSE
but this batch displays
1
2
3
5
7
8
how do i make the empty lines as output as well as they were intended
all 4 for do loops do not display empty lines