tags:

views:

28

answers:

1

Hello, I have a .bat file with the following structure:

istruction1[newline]

I would like to append some parameters in a way that the resulting file is:

istruction1 param

currently i have:

istruction1[newline]
param

Basically I want to get rid of the newline...how can I do that?

thanks a lot!

+1  A: 

Try this one:

@echo off
for /f "delims=" %%i in (my.bat) DO echo %%i param

This little script will append param at the end of every (non empty) line in your input file (my.bat). You can also issue that directly from the command line, simply substituting %% with a single %:

for /f "delims=" %i in (my.bat) DO echo %i param
Frank Bollack
it works perfectly! Thanks a lot!
elos
Note that this will strip empty lines from the file.
Joey