Re: Open Write?
- To: mathgroup at smc.vnet.net
 - Subject: [mg30929] Re: Open Write?
 - From: "Carl T. Bergstrom" <cbergst at u.washington.edu>
 - Date: Thu, 27 Sep 2001 02:16:47 -0400 (EDT)
 - Organization: Ye 'Ol Disorganized NNTPCache groupie
 - References: <9omhqc$nlo$1@smc.vnet.net>
 - Sender: owner-wri-mathgroup at wolfram.com
 
In article <9omhqc$nlo$1 at smc.vnet.net>, "Moranresearch"
<Moranresearch at aol.com> wrote:
> Here is a simple loop that generates values. Do[Print[x^2], {x, 0, 1,
> .1}]
> How can I write these values to a file eg. Values.txt? The Print command
> is not necessary.
> Thank you.
Here are two different approaches:
myDataMatrix = {{1, 2}, {3, 4}};
dataTable = TableForm[myDataMatrix];	
Put[OutputForm[dataTable], "mydata.dat"];
---
Output file is then:
 1   2
3   4
---
Alternatively, 
Export["mydata2.dat", myDataMatrix, "CSV"]
Output file becomes:
1,2
3,4
Best Regards,
Carl
-------------------------------------------------------------------
Carl T. Bergstrom                          cbergst at u.washington.edu
428 Kincaid Hall                   http://calvino.biology.emory.edu
Department of Zoology
University of Washington                     Office: (206) 685-3487
Box 351800                                      Lab: (206) 685-3600
Seattle, WA 98195-1800                          Fax: (206) 543-3041
-------------------------------------------------------------------