Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1992

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

Search the Archive


  • To: mathgroup at
  • Subject: FORTRAN
  • From: CHALLACOMBE at
  • Date: Fri, 19 Jun 1992 11:07:13 EDT

	Dear MathGroup,
John Pender writes;
> does anybody know how to get mathematica to write a bunch of numbers to
> a file in fortran-compatible format?  the best option i've found so far
> is to use the ColumnForm command, but as you can see below, the output
> isn't compatible with standard fortran (which uses ** instead of ^).  if
> you use the FortranForm command you get (at least on my machine) a lot of
> excess baggage as well.  i can work around this problem, but it sure seems
> to me that there's got to be a nice way to do such a simple i/o excercise.

Here is an (inelegent) way of generating strings suitable for output in FORTRAN 
data statements, etc.;

format[x_]:=ToString[ PaddedForm[x,{14,13},{ 
I use it for writing data statements as follows;

            StringJoin["     > ",format[b[i,k+0]],", ",format[b[i,k+1]], ", 

			Hope this helps,
				Matt Challacombe
				Program in Chemical Physics and SCRI
				FSU, Tallahasse, 32306
				(challacombe at

  • Prev by Date: Math into ASCII
  • Next by Date: diffusion limited aggregation simulation (a re-posting)
  • Previous by thread: Math into ASCII
  • Next by thread: Re> FORTRAN