user1553605
user1553605

Reputation: 1393

Redirect the output of a command to file without newline in windows

I need to redirect the command line output to the file without newline in windows.

for example,

   "%VISUALSVN_SERVER%bin\svnlook.exe" log -r 128 C:\Repositories > log.txt

The output of this command is just one line. Here i need to redirect the output to log.txt file without newline.

I'm able to echo the variable without newline to the file by following command,

  echo | set /p log=log_comments>log.txt

Thanks in advance.

Upvotes: 2

Views: 3356

Answers (1)

Joey
Joey

Reputation: 354864

You can probably use the same trick and a for /f loop:

for /f %%L in ('"%VISUALSVN_SERVER%bin\svnlook.exe" log -r 128 C:\Repositories') do (
  <nul set /p "X=%%L" >log.txt
)

Upvotes: 3

Related Questions