Hi all -
I'm working on getting the "crosstab parser"
(that I mentioned recently) up and running. As part of that, I'm wanting
to read a text file ( which would have column headings, then the column values)
into an STL map. The map would have a typedef as follows -
typedef map<string, vector>
So, the _first line_ of my text file (the
headings, which are strings) would be the map keys, and the rest of the
file would be put into the vectors for each heading .
An example of the text file would be -
region, state, city, salesman, product, price,
NW, Washington, Seattle, Jones, car, 10000, 4,
NW, Washington, Seattle, Smith, PC, 2000, 6, 12000
I've searched "up hill and down dale" for an
example of some C++ code that does this, but to no avail. So, I'm
hoping that maybe someone here may be able to help. Many thanks
Oh - btw , if there's an easier, more
straightforward way of reading in files with headings (so I can easily access
each variable), then that's fine - I'll use that ....