Re: Improt vs Get
- To: mathgroup at smc.vnet.net
- Subject: [mg119954] Re: Improt vs Get
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Fri, 1 Jul 2011 04:49:54 -0400 (EDT)
On 6/30/11 at 6:30 AM, smartin at seas.harvard.edu (Scot T. Martin) wrote: >In summary, use Get[...] rarely and only for stuff generated and >saved with in Mathematica, such as by DumpSave[...], packages, etc. Or stuff that has been pre-processed so that when Get reads the data and has Mathematica evaluate it you get what you want. For example, change 0.5506E+01 to 0.5506 10^+01, i.e., replace the E with " 10^" and Get does what you want. Pre-processing very large files in this manner with a text editor and grep is often far more efficient than using Import. >Use Import[...] for stuff made outside of Mathematica that you are >importing into Mathematica. This works fine with caveats. The biggest is for very large files, there is a significant execution overhead associated with Import. The key advantage of Import over other methods to read data into Mathematica is if the file format is one Import understands, you do not have to understand the file format. Import does the work for you. But this comes at a price.