reading ascii in array merging with strsplit [message #52521] |
Tue, 06 February 2007 05:46 |
leatherback
Messages: 15 Registered: November 2005
|
Junior Member |
|
|
Hi All,
I use a template to read_ascii data of the following format:
D9 6-2-1998 17:00 37,59 0,59 36,5
Which returns a structure of arrays.
However, the date (6-2-1998) and time (17:00) I need to convert to
julian time, which takes
JULDAY(Month, Day, Year, Hour, Minute, Second)
I -could- for each entry in the list do a strsplit:
daysarr = STRTRIM(strsplit(data.date[ThisLine], '-', /extract), 2)
timearr = STRTRIM(strsplit(data.time[ThisLine], ':', /extract), 2)
and create the julian day:
Jul_Day = julday(daysarr[1],daysarr[0],daysarr[0],timearr[0],
timearr[1], 0)
This seems very elaborate if you repeat this hundreds of thousands of
times. Is there a better solution to this? Can I somehow specify a
template with multiple field separators?
Thanks,
Jelle.
|
|
|