need bat performing cut and paste

January 7, 2010 at 19:11:41
Specs: Windows XP
i've a input file(input.txt) having more than 2000 lines in the format
line1,
line2,
.....
...
line n

i need output in different files by taking say 50 lines to each output file...like

out1.txt has
line1,line2,...line50

out2.txt has
line51,line52,...line100

so on....


plz help

thanks in advance


See More: need bat performing cut and paste

Report •

#1
January 7, 2010 at 20:05:24
"out1.txt has
line1,line2,...line50

out2.txt has
line51,line52,...line100"

Do you really want 50 lines combined ito 1?


=====================================
Helping others achieve escape felicity

M2


Report •

#2
January 7, 2010 at 20:09:27
ys 1 to 50 ,51 to 100 so on...but final out file may be less than 50 lines...

Report •

#3
January 7, 2010 at 20:23:21
Let's try this again.

Do you really want 50 lines combined ito 1 LINE?


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
January 7, 2010 at 22:02:41
yaa ...50 lines to be combined to 1 line

Report •

#5
January 8, 2010 at 13:15:56
@echo off & setlocal enabledelayedexpansion
set /a words=50
set /a lc=0
set /a ser=0
set line=
for /f "tokens=* delims=" %%a in (newfile) do (
set /a lc+=1
echo.!lc! !line!
set line=!line!%%a
if !lc! equ !words! (
set /a ser+=1
echo outputting !line!
>out!ser!.txt echo.!line!
set line=
set /a lc=0
)
)

Report •

#6
January 11, 2010 at 01:07:40
woww....thanks a lot yaarrr

Report •

Ask Question