reading multiple data types into arrays [message #54720] |
Mon, 09 July 2007 15:36 |
Josh
Messages: 21 Registered: June 2007
|
Junior Member |
|
|
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
|
|
|