creating a file to read other files to extract data

checkerboard's Avatar, Join Date: Feb 2007
Newbie Member
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.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.
DaWei's Avatar, Join Date: Dec 2006
Team Leader
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