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

Home » Public Forums » archive » Read ASCII time format question!!
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 ASCII time format question!! [message #89444 is a reply to message #89439] Fri, 17 October 2014 01:24 Go to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
> I have a problem with the time format, I can plot but When I am print the time I got a float values. I would like to get time like 16:10 (hh:mm).

Here's an alternative solution using time format codes:

pro tmp_time
f="d:\mydocs\tmp\time_test.txt"
n=file_lines(f)

t=0d
b=fltarr(3)

print,"Time Bx By Bz"

openr,1,f
for i=0,n-1 do begin
readf,1,t,b,format=("(C(CDI,x,CMOI,x,CYI,x,CHI,x,CMI,x,CSF,x),3g0) ")
print,t,b,format=('(C(CHI2,".",CMI2,x),3(f0.2,x))')
endfor
close,1

end

If you read time like this, you'll also solve your next problem... how to make a plot/calculation using the data.


cheers,
Greg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: cgimage - two images on the same window ?
Next Topic: Converting days since 0-01-01 to Julian/Gregorian days - how can IDL recognise 0 AD?

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

Current Time: Wed Oct 08 15:49:36 PDT 2025

Total time taken to generate the page: 0.00427 seconds