Re: outputting lists to a file
- To: mathgroup at smc.vnet.net
- Subject: [mg9896] Re: outputting lists to a file
- From: phbrf at t-online.de (Peter Breitfeld)
- Date: Sun, 30 Nov 1997 20:16:44 -0500
- Organization: T-Online
- References: <65mbkm$b17@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 28 Nov 1997, Ian Hawkins wrote:
: I have a simple problem,
:
: Suppose I have a mathematica list that represents a number of
: n-dimensional vectors. e.g. {{2,3},{3,2},{6,5},{7,7},{1,1}}
: which represents five 2d vectors.
:
: Does anyone know an easy way of outputting this list to a file so that
: each line contains just a single n-dim vector with elements seperated
: by either spaces or commas.
:
I don't know if it's the best way, but try the following:
list={{2,3},{3,2},{6,5},{7,7},{1,1}} strm=OpenWrite["test.bla"];
Do[
Write[strm,list[[i]][[1]],SpaceForm[1],list[[i]][[2]]],
{i,1,Length[list]}
];
Close[strm]
es gruesst
- Peter
+===== _/_/_/_/ _/_/_/_/ _/_/_/_/ = Peter Breitfeld ===========+
| _/ _/ _/ _/ _/ Kreuzgasse 4 |
| _/_/_/_/ _/_/_/_/ _/_/_/ 88348 Saulgau / GERMANY |
| _/ _/ _/ _/ _/ eMail: phbrf at t-online.de |
+= _/_/_/_/ _/ _/ _/ ========== (PGP Public Key available) =+