Batch script problem:splitting a big txt file into many 4000 lines
script:
@echo off
setlocal enableextensions disabledelayedexpansion
set "nLines=4000"
set "line=0"
for /f %%a in ('type file.txt^|find /c /v ""') do set "fileLines=%%a"
< "file.txt" (for /l %%a in (1 1 %fileLines%) do (
set /p "data="
set /a "file=1+line/%nLines%", "line+=1"
setlocal enabledelayedexpansion
>>"pass!file!.txt" echo(!data!
endlocal
))
endlocal
Line 4001 is not empty,looks strange,here snapshot:
On my Laptop this script works perfect on my pc and my rdp NO,i don't understand why