IO¶
read first line¶
limits:
max line length of 1021 bytes, not including EOL
file must use Windows style EOL of CarriageReturn LineFeed
trailing control characters will be stripped from the line
read from second line¶
@echo off
setlocal EnableDelayedExpansion
set file=myfile.txt
set curdir=%~dp0
set /p line1=< %file%
set i=0
echo %date% %time% ln: %line1%
for /f %%a in (%file%) do (
set /a i=!i!+1
if !i! GTR 1 (
echo !date! !time! !i! ln: %%a
)
)
echo %date% %time% all done!