Re: Read large ascii file quickly [message #74276 is a reply to message #74275] |
Fri, 07 January 2011 14:40   |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <MPG.2790dbf37472c29b989913@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:
> Well, I don't know about that. Reading ill-formed ASCII
> files is slow, *because* you have to do it in a loop,
> as READ_ASCII does. But, if you have well-formed
> ASCII input (usually this means written with some kind
> of format statement), I've never found IDL to be slow reading it.
But reading ASCII will always be noticeably slower than
reading the equivalent binary because of the overhead involved
in converting from ASCII to the internal binary representation.
Binary formats, on the other hand, basically just move bytes
from the file to memory.
ASCII files are quite portable, but they are usually inefficient
in terms of storage size. They also rarely carry adequate metadata
within the file itself, but that is a failing of the file's
author rather than the format, per se.
Ah, remember the good old days when you had to try to read
a binary file written on a 60-bit CDC machine on a byte-
oriented machine. :-)
Ken Bowman
|
|
|