Appending a file using loop in DOS

January 3, 2011 at 02:54:00
Specs: Windows Vista
My inputfile inp.txt has
aa
bb
cc
dd
My output file out.txt has to look like
MyText=aa,bb,cc,dd

Kindly help with DOS code for this to be included in batch file


See More: Appending a file using loop in DOS

Report •

#1
January 3, 2011 at 03:07:42
@echo off & setLocal enableDELAYedeXpansion

for /f "tokens=* delims= " %%a in (inp.txt) do (
set S=!S!%%a.
)
set S=!S:~0,-1!
set S=MyText=!S!
> newfile echo.!S!


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
January 3, 2011 at 03:18:41
Thanks!!

Report •
Related Solutions


Ask Question