MathGroup Archive 1991

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

Search the Archive

List print out

  • To: mathgroup at
  • Subject: List print out
  • From: billl at
  • Date: Sat, 10 Aug 91 14:41:52 -0700

Is there a sensible way to print out a list into a file so that it
appears as columns and rows (spaces and newlines) instead of as a list
with curly brackets.

I'm currently using :

printout[file_,ls_] := Block[{out = OpenWrite[file],
	                lim1 = Length[ls],lim2 = Length[ls[[1]]]},
    	  For[y=1,y<lim2,y++,WriteString[out,ls[[x]][[y]]," "]];

which is not very elegant nor very fast for large lists.
I've tried fancier things like:

printout[file_,ls_] := Block[{out = OpenWrite[file]},

but this puts multiple spaces between numbers so that the columns line

There must be an easy way to do this.  What is it?

Bill Lytton				billl at
Salk Institute				tel 619 453 4100 x124
10010 N. Torrey Pines Rd.		fax 619 587 0417
La Jolla, CA  92037			

  • Prev by Date: Yoda is moving
  • Next by Date: Re: Fortran Format
  • Previous by thread: Yoda is moving
  • Next by thread: Re: Fortran Format