[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

reading files with date- and time - columns



Hallo,

I have files for example in such a format:

File : s.log
;DATE          TIME       n x VALUES
23.01.2001 08:39:41 21 21.4 0
23.01.2001 08:40:16 21 21.3 0
23.01.2001 08:40:51 21 21.3 0
23.01.2001 08:41:26 21 21.4 0

or such a format:

;DATE         TIME                n x VALUES
2/23/2001   08:39:41.643  34.660
2/23/2001   08:49:41.456  34.960


I cannot find a solution for reading the date- and timeformat. My best
result was this :

IDL> openr,1,'s.log'
IDL> readf,1,format='(C(CDI3,".",CMOI3,".",CYI4,"
",CHI2,":",CMI2,":",CSI2))',x
IDL> print,x
  2.45193e+06
IDL> CALDAT, x, Month, Day, Year, Hour, Minute, Second
% Compiled module: CALDAT.
IDL>
IDL> print,Month, Day, Year, Hour, Minute, Second
           1          23        2001           0           0      0.00000000
IDL> print,!version
{ alpha vms vms 5.4 Sep 25 2000      32      32}
IDL> close,1

But where are the hours, minutes  and seconds.


Thanks  in advance
Thomas Zeschke