|
| garrett (12) | |||||
| I am attempting to use multidimensional vectors to store the following dataset which is stored in a text file. I am looking for suggestions on how to design the code.
I am able to determine the number of rows of data by reading the line below. The first digit represents the number of rows.
Therefore i able to use the find() and substrc() functions, and convert it to an interger. This would establish one of boundaries of my for loop. In this case there would be 9 rows of data. This is the first row of data:
I need to store this in columns 1 to 6. Here lies one of my problems, if i use the getline function, how do i read the 2nd line. Within the header which isn't given above, it states how many readings in a row. In this case, there is 6. If the readings are more than 4, it goes to another line. Also, the characters are always a fixed number apart, therefor i count the characters to extract each value to put them in each column. Then use a for loop to repeat it to the other lines. | |||||
| garrett (12) | |||
I am thinking about structuring my multi-dimensional vectors using the code below. It was suggested by ropez in the forum discussion http://www.cplusplus.com/forum/general/833/ .
| |||
| garrett (12) | |
| I solved the problem using Data Structures and multi-dimensional vectors. The code is for an Rinex Observation Reader. The solution is long, if anyone in the future need assistance feel free to message me. | |
This topic is archived - New replies not allowed.
