MathGroup Archive 2008

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

Search the Archive

Re: Import/Export Problem

  • To: mathgroup at
  • Subject: [mg90516] Re: Import/Export Problem
  • From: Bill Rowe <readnews at>
  • Date: Fri, 11 Jul 2008 02:05:33 -0400 (EDT)

On 7/10/08 at 7:07 AM, Kevin.McCann at (Kevin J. McCann) wrote:

>I have computed a vector function {Bx,By,Bz} as a function of
>{x,y,z}. For example, here is the first element in the collection:


>I export it:

>Export["btbl2.dat", btbl2]

>(the variable is btbl2.)

>And then Import it as btbl3:


>Here is what the first element, btbl3[[1]] looks like:


>Note the double commas!

While it is not immediately apparent to me why the double commas
occur, using Export/Import to write out a variable to be read
back into Mathematica at a later time is inefficient. If this
all that is to be done, using Put/Get is much more efficient.
The disadvantage of using Put to write out contents of a
variable to a file is the resulting file is not in a format
generally suitable for use with other programs. The advantage of
using Put and Get for this purpose, is the overhead resulting
from Import's need to check data types etc. is avoided.

Even more efficient than using Put would be using
DumpSave/DumpGet. However, the format used here is not portable
across different platforms using Mathematica.

  • Prev by Date: How to replace TextListPlot ?
  • Next by Date: Re: Symbol function, a question
  • Previous by thread: Re: Import/Export Problem
  • Next by thread: Re: Import/Export Problem