Single File Into Multiple Files -
i have csv file 4 columns , 279 rows need split individual files.
i using following code there 1 small problem, need when creates new file each column adds new line. @ moment prints off 4 columns in 1 row
e.g
23/07/2014 11:00 24/07/2014 09:27 35386515447 1771969 s walsh
needs be
23/07/2014 11:00
24/07/2014 09:27
35386515447
1771969 s walsh
@echo off setlocal set "destdir=c:\destdir" /f "tokens=1*delims=:" %%a in ('findstr /n "." message.txt') ( >"%destdir%\filename%%a.txt" echo(%%b) goto :eof
test - paste notepad , says tab
replace tab character.
@echo off setlocal set "destdir=c:\destdir" /f "tokens=1,*delims=:" %%a in ('findstr /n "." message.txt') ( /f "tokens=1,2,3,4 delims=tab" %%b in ("%%a") ( >>"%destdir%\filename%%a.txt" echo(%%b >>"%destdir%\filename%%a.txt" echo(%%c >>"%destdir%\filename%%a.txt" echo(%%d >>"%destdir%\filename%%a.txt" echo(%%e ) )
Comments
Post a Comment