MathGroup Archive 2004

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

Search the Archive

Import[filename,"CSV"] is so slooooooooow!

  • To: mathgroup at
  • Subject: [mg45920] Import[filename,"CSV"] is so slooooooooow!
  • From: "1.156" <rob at>
  • Date: Thu, 29 Jan 2004 05:36:46 -0500 (EST)
  • Sender: owner-wri-mathgroup at

I'm getting data in CSV files to analyze.  With the new ver. 4.2 I can 
get these data in nicely using
data = Import["filename", "CSV"]

but it takes 30 seconds to get in a 100kB file.  And I've got to do some 
much longer files.

On the other hand, if I change all the comma delimiters to spaces, I can 
get the data in using
inFile = OpenRead["filename"];
y = ReadList[inFile, Number, RecordLists -> True];

This pulls in the same 100kB file in a second or so.  But, doing this 
comma to space conversion is truly slow (using Word).

So, can someone out there enlighten me with a suggestion on how to 
either speed up Import or get ReadList to handle comma delimiters?

Thanks and Regards, Rob

  • Prev by Date: Question: formatting text, sections
  • Next by Date: RE: displaying images in the complex plane
  • Previous by thread: RE: Question: formatting text, sections
  • Next by thread: Re: Import[filename,"CSV"] is so slooooooooow!