The reason why I did not post the script is related to its complexity that may lead to misunderstands. But here is at your own risk:
@Echo Off
:: CTXT.BAT Syntax: CTxt [Unit:][PathName]FileName
:: Cut-down the specified file in pieces of 50 lines each
:: naming FileName_nn.ext starting from 01.
:: Win NT/2K/XP required; blanks not allowed in FName
If not %1.==[]. (
Cmd /V:On /C Call %0 [] %1
GoTo :EOF)
Shift
Echo.
If %1.==. (Echo File missing & GoTo :EOF)
If not exist %~f1 (
Echo File %~f1 not found
GoTo :EOF)
Set Piece=50
Set Count=1
Set FileN=1
Set FileS=0!FileN!
Echo Cutting-down %~f1 in pieces of !Piece! lines...
Echo.
If exist %~dpn1_*%~x1 Del %~dpn1_*%~x1
For /F "tokens=* delims=" %%A in (%1) Do (
Echo %%A>> %~dpn1_!FileS!%~x1
Set /A Count=!Count!+1
If !Count! gtr !Piece! (
Set Count=1
Set /A FileN=!FileN!+1
Set FileS=!FileN!
If !FileS! lss 10 Set FileS=0!FileS!
)
)
Dir /B %~dpn1_*%~x1
Echo.
Echo Processing completed - !FileN! files written
Set Count=
Set FileN=
Set FileS=
Set Piece=