Read values one at a time from a text file which is in colomn/row format and space delimited
Posted on 2003-04-01
I have a problem and I am sure there is an answer to it. Can someone please provide me with the code.
I would like to read a simple text file which is space delimited (2 or 3 spaces) and in a row/column format. Each row has one set of information where the first column is a combination of letters and numbers (which i will call Stations) and the rest of the columns are floats. I want to basically read one row at a time and each value on that line until the end of the file by reading the first value until the first space is found and then the second value, and so on. And the same for the next row.
The objective is to do some calculation with the floats which belong to a particular Station.
Can somebody please help asap.