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

Home » Public Forums » archive » reading ascii in array merging with strsplit
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
reading ascii in array merging with strsplit [message #52521] Tue, 06 February 2007 05:46
leatherback is currently offline  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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDLDE Custom Layout
Next Topic: Re: image mapping

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

Current Time: Sun Oct 12 16:32:40 PDT 2025

Total time taken to generate the page: 0.01311 seconds