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

Home » Public Forums » archive » Re: reading multiple data types into arrays
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: reading multiple data types into arrays [message #54718 is a reply to message #54714] Mon, 09 July 2007 23:57 Go to previous messageGo to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
On Jul 10, 12:36 am, Josh <joshuamonta...@gmail.com> wrote:
> Hi,
>
> I'm trying to read in data from a file that has the following format:
>
> 231359152 09/25/2003 18:38:35.816 20.013574 25.668425
> 626.779 14.396667
>
> I'm having no problems getting the fourth, fifth, and sixth columns of
> data into double arrays with a statement like this:
>
> readf, lun, recNum, date, time, lat, lon, elev, geoid
>
> and a for loop. But I would like to get the second column in an
> array, too. My intuition says it should be a string because of the
> nasty /'s in it (ultimately, I'd like these dates to be the
> independant axis values).
>
> I tried declaring the variable date as a string beforehand (date = '
> '), but then that slurps the entire line (all columns) into that
> variable. If I don't declare it as a string and try to put it into a
> string array (strArr), it becomes 9.00000.
>
> I'm reading the documentation for explicitly formatted input, but am
> having trouble figuring out how to apply it here.
>
> As always, all suggestions are greatly appreciated!
> -Josh

I'd probably read the whole line as a string then split it on the
spaces with strsplit() and convert after. Better still, you might just
read the whole file into a string array and chop it up with strpos()
and strmid().

Greg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: A Challenge?
Next Topic: Re: MOD43B3 Col.4 Processing. unexpected error message. why?

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

Current Time: Sat Oct 11 14:34:34 PDT 2025

Total time taken to generate the page: 0.39484 seconds