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

Home » Public Forums » archive » Re: readf help!
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: readf help! [message #47514 is a reply to message #47512] Tue, 14 February 2006 09:06 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
vorticitywolfe@gmail.com wrote:
> Hello,
>
> I need a little help with the readf procedure. I have a few large data
> files that I am trying to make run faster by reading directly from the
> file into variables rather than reading them as a string and splitting
> them eventually placing them into their representative files; however,
> I'm running into a problem with converting the time which is in seconds
> since 1970 to a long #... I've tried numerous format codes and none
> have been successful. My data simplified data file is as follows:
>
> 001,1137369600,0000000,00.00,00002.22,-00.3,009.3,09.4*27AE
> 001,1137369601,0000000,00.00,00002.22,-00.3,009.2,09.4*9AA9
> 001,1137369602,0000000,00.00,00002.32,-00.3,009.3,09.4*1DA3
>
> My program looks like this:
>
> openr, lun, fname, /GET_LUN
> for i=0l, vs-1 do begin
> readf, lun, a,b,c,d,e,f,g,h
> print,a,long(b),c,d,e,f,g,h
> endfor
> FREE_LUN, lun
> end
>
> My output looks like this:
> 1.00000 1137369600 0.000000 0.000000 2.22000
> -0.300000 9.30000 9.40000
> 1.00000 1137369600 0.000000 0.000000 2.22000
> -0.300000 9.20000 9.40000
> 1.00000 1137369600 0.000000 0.000000 2.32000
> -0.300000 9.30000 9.40000
>
> See how the seconds do not increment, but everything else does. This
> leads me to believe that it is something wrong with the formatting. Can
> anyone help or explain how to overcome this? Thanks! Jon
>
You should make the variable b of type long or double, you get limited
precision beacuse you b is of type float (I guess).

Ciao,
Paolo
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: cmlib
Next Topic: tv and tvscl problems

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

Current Time: Fri Oct 10 05:52:44 PDT 2025

Total time taken to generate the page: 0.55979 seconds