# Piping console output into a txt file

**URL:** https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118
**Category:** Discussion
**Created:** [June 28, 2006, 3:12am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118 "2006-06-28T03:12:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 28, 2006, 3:12am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118/1 "2006-06-28T03:12:04Z")

</div>

I am trying to use the command line piping “\>” to capture the output into a text file, then do some processing later. But somehow, execute program does not even create the text file.  
I am using Execute Program action:  
hello.exe  
Parameters: /param \> report.txt  
  
Anything i missed?  
Thanks

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [June 29, 2006, 1:17am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118/2 "2006-06-29T01:17:04Z")

</div>

Hi Sherry,  
  
Redirecting output with \> is actually a DOS shell feature, so you have two options:  
  
1) Use the ‘Run DOS Command’ action to run the executable, including the redirect.  
  
2) Use the ‘Log to Variable’ option on the Execute Program action, and then use the Write To Text File action to write out the variable contents.  
  
Hth.

---

<div class="post-metadata">

### Author: ![tomcos](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@tomcos](https://www.finalbuilder.com/forums/u/tomcos)
#### Post date: [July 19, 2006, 1:44am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118/3 "2006-07-19T01:44:07Z")

</div>

We’re having a similar problem: we’re trying to redirect Subversion output by using a basic ‘Run DOS Command’ because redirection (\>) is not possible with the ‘Subversion Generic’ action: svn propget svn:externals “%source%” \> "%TEMP%\externals.txt"  
  
Simply using ‘svn’ or a full path to the svn executable is not really desired and we didn’t find out how to get the ‘Subversion Binaries Location’ configuration from the options by scripting, there doesn’t seem to be a ‘Subversion as OptionsName’ for GetOptionsObject.  
  
Also, when putting log output to a variable and then writing that to a file as Angus Gratton suggested, you get not only the output but also undesired extra lines in the beginning and the end of the output file (SVN Parameters etc.)…  
  
Either it should be possible to   
A) put log output to a variable with the option to put ONLY real output into it (preferably!)  
B) or offer the subversion binaries location for scripting

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [July 20, 2006, 1:59am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118/4 "2006-07-20T01:59:19Z")

</div>

Hi Tom,  
  
The options should be exposed to scripting… that is a bug.  
  
I’ve just fixed it and will do a new build today.  
  
.t8

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [July 20, 2006, 8:59am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118/5 "2006-07-20T08:59:38Z")

</div>

Here’s the new build:  
[https://www.finalbuilder.com/downloads/finalbuilder/410/FB410\_256.exe](https://www.finalbuilder.com/downloads/finalbuilder/410/FB410_256.exe)

---

<div class="post-metadata">

### Author: ![tomcos](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@tomcos](https://www.finalbuilder.com/forums/u/tomcos)
#### Post date: [July 20, 2006, 9:13am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118/6 "2006-07-20T09:13:43Z")

</div>

Thanks for the quick response and the new release!  
I’m quite surprised by the speed this bug fix was applied!

---

<div class="post-metadata">

### Author: ![tomcos](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@tomcos](https://www.finalbuilder.com/forums/u/tomcos)
#### Post date: [July 20, 2006, 10:34am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118/7 "2006-07-20T10:34:26Z")

</div>

After a lot of trial and error, this seems to work (tSvn is a FB project variable):  
  
Dim sSvnOptions  
Set sSvnOptions = GetOptionsObject(“Subversion (SVN)”)  
tSvn = sSvnOptions.SubversionLocation() & “\svn.exe”

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [July 20, 2006, 11:40am UTC](https://www.finalbuilder.com/forums/t/piping-console-output-into-a-txt-file/118/8 "2006-07-20T11:40:52Z")

</div>

great! glad it's sorted :)  
  
.t8
