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

Home » Public Forums » archive » Read large ascii file quickly
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Read large ascii file quickly [message #74302] Thu, 06 January 2011 13:39
Paul Magdon is currently offline  Paul Magdon
Messages: 8
Registered: January 2011
Junior Member
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Linking Libraries in IDL
Next Topic: Reprojecting an image file derived from Level 1B MODIS HDF

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

Current Time: Wed Oct 08 17:37:48 PDT 2025

Total time taken to generate the page: 0.00421 seconds