MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Save print in textfile

  • To: mathgroup at
  • Subject: [mg15564] Re: [mg15528] Save print in textfile
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Tue, 26 Jan 1999 13:44:44 -0500 (EST)
  • Sender: owner-wri-mathgroup at

If you must use Print you can do the following. You can open a new
streem with 
You can then append this new streem to the $Output channel with 
Now whenever you use Print, what you print will be saved in the file
textfile.txt. By default InputForm is used but you can explicitly write
to get dog rather than "dog" in your text file. However, I would never
use this sort of low level stuff, its much too complicated!
 Instead of using  Print["sample: ",name] and so on you can just
evaluate a string, say 
ber] and so on  and save it to a file with  OutputForm[v]>>textfile.txt
(You should combine this with SetDirectory[] if you want to save your
file in a different directory from the one you are working in).

On Mon, Jan 18, 1999, wgrebe <wgrebe at> wrote:

>I want to save the result of a series of Print commands in a textfile.
>For example:
>Print["sample: ",name];
>Print["___________________________________"]; Print[" conditions: "
>Print["___________________________________"]; ];
>results in the output:
>sample: aab
>conditions: 34
>This output I want to have in the file "textfile.txt" in the directory
>Thank you
>                            Witold
>wgrebe at

Andrzej Kozlowski
Toyama International University

  • Prev by Date: Re: Save print in textfile
  • Next by Date: Re: CellGroupingRules?
  • Previous by thread: Re: Save print in textfile
  • Next by thread: Axis breaks