MathGroup Archive 2002

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

Search the Archive

Re: How to export plain text numbers!?

  • To: mathgroup at
  • Subject: [mg36784] Re: How to export plain text numbers!?
  • From: "Lawrence A. Walker Jr." <lwalker701 at>
  • Date: Wed, 25 Sep 2002 01:51:07 -0400 (EDT)
  • Organization: Morgan State University, COMSARE
  • References: <ammfo0$lkj$>
  • Sender: owner-wri-mathgroup at

Hi Soxos,

You can use

Export["file.dat", expr] where expr is a two-dimensional array.

Or for more flexibility study the following.

Assuming data has n rows and 2 columns.

file = OpenWrite["file.dat"];
      (* the N may be redundant haven't tested the
         code w/o it *)
      str = ToString[PaddedForm[N[#[[1]]],{10,6}]]<>"   "<>

      (* make numbers e notation:
         the *^ notation has given me fits, so I just put this
         in as a precaution *)
      str = StringReplace[str, "*^" -> "e"];
      WriteString[file, str, "\n"]
   )&, data];


Hope this helps,

Soxos wrote:
> Hi,
> I'm trying to export a table from Mathematica 4.0 to Notepad, for examples,
> or something similar, but it's impossible for me! It always exports the cell
> with all its "rubbish", or an image (if I use Word).
> How can I export just plain _numbers_?
> Thanx
> Fip

Lawrence A. Walker Jr.

  • Prev by Date: Exporting Fonts Mathematica 4.2 Linux
  • Next by Date: A Bessel integral
  • Previous by thread: Re: How to export plain text numbers!?
  • Next by thread: Question KeyEventTranslation