comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Read large ascii file quickly
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Read large ascii file quickly [message #74301 is a reply to message #74300] Thu, 06 January 2011 13:53 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jan 6, 7:39 pm, Paul Magdon <paulmag...@yahoo.de> wrote:
> Dear all,
> I have to read a large ascii file (2.5e+07 lines) into a 5000x5000 intarr. The code below works fine but it takes roughly 15-20min on my machine( not the oldest :) ). Any suggestions how to accelerate this?
>
> CODE:
>
> OPENR, unit, file, /GET_LUN
>
> result = INTARR(5000,5000, /NOZERO)
> count=0d
> WHILE (NOT EOF(unit)) DO BEGIN
>   READF, unit, a,b,c,d,e,f
>   print, count
>   result(count) =FIX(f)
>   count++
> ENDWHILE
>
> CLOSE, unit & FREE_LUN, unit

Just from that it is hard to say. How is the file organized (can you
show a few lines of it)? What are the types of a,b,c,d,e,f?

Just as a side note, if you use free_lun, the call to close is
unnecessary. free_lun closes the unit if it is open.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: reading portions of a large binary file
Next Topic: Re: Fitting an ellipsoid with MPFITEXPR

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 21:09:21 PDT 2025

Total time taken to generate the page: 0.88394 seconds