Let's say, I have 3 files, one which is a masterfile which contains the name of 2 other files I want to read data from.
For instance:
//Masterfile.txt
abc.txt
xyz.txt
//abc.txt
Time
0.01 0.02 0.03 0.04
//xyz.txt
Money
100
200
300
400
How do I create an input stream such that I can read just the masterfile, which in turns read abc.txt and xyz.txt and put time and money into arrays??
Thank you.
|
Go4Expert Founder
|
![]() |
| 12Feb2007,22:46 | #2 |
|
ReadLine the Master file and for each file names in the masterfiles just read the lines of the files to get the arrays of buffer to store as you like to.
|
|
Team Leader
|
![]() |
| 13Feb2007,01:57 | #3 |
|
Pseudo-code
Code:
Open masterfile for reading
While not EOF (masterfile)
read item as filename
open filename for reading
read item from filename as filetype (money/time)
set data index to zero
While not EOF (filename)
read item from filename as data
store data in filetype_array [index]
increment index
end while
close filename
end while
close masterfile
|


