Batch-split eine text-Datei

Habe ich diese batch-Datei zu splitten, eine txt-Datei:

@echo off
for /f "tokens=1*delims=:" %%a in ('findstr /n "^" "PASSWORD.txt"') do for /f "delims=~" %%c in ("%%~b") do >"text%%a.txt" echo(%%c
pause

Es funktioniert, aber es spaltet es Zeile für Zeile. Wie kann ich sicherstellen, teilen Sie es alle 5000 Zeilen. Vielen Dank im Voraus.

Edit:

I have just tried this:

@echo off
setlocal ENABLEDELAYEDEXPANSION
REM Edit this value to change the name of the file that needs splitting. Include the extension.
SET BFN=passwordAll.txt
REM Edit this value to change the number of lines per file.
SET LPF=50000
REM Edit this value to change the name of each short file. It will be followed by a number indicating where it is in the list.
SET SFN=SplitFile

REM Do not change beyond this line.

SET SFX=%BFN:~-3%

SET /A LineNum=0
SET /A FileNum=1

For /F "delims==" %%l in (%BFN%) Do (
SET /A LineNum+=1

echo %%l >> %SFN%!FileNum!.%SFX%

if !LineNum! EQU !LPF! (
SET /A LineNum=0
SET /A FileNum+=1
)

)
endlocal
Pause
exit

Aber ich bekomme eine Fehlermeldung: Not enough storage is available to process this command

InformationsquelleAutor 09stephenb | 2014-05-11
Schreibe einen Kommentar