G
Gary Wessle
Hi
I would appreciate any idea on how to approach this task.
I have files which look like this:
file1
men 234
women 112
children 4
cars 11
file2
men 344
children 34
dogs 9
....
I need to print a report of all the data in the files which look like
this.
files men women chidden cars dogs
file1 234 112 4 11 0
file2 344 0 34 0 9
that is a table with fields names are columns and file names are
rows, the columns name all possible categories in the files, raw names
the files, a zero where there is no data for that particular field in
any given file.
I was thinking, open files, read data into a map, iterate through the
map, depending on the key, place the value in vector so that we have
vector for men, and another for women,... with the size of "number of
files", then foreach vector<category> (foreach vector<files>) cout
with setw(int) and so forth.
thanks
I would appreciate any idea on how to approach this task.
I have files which look like this:
file1
men 234
women 112
children 4
cars 11
file2
men 344
children 34
dogs 9
....
I need to print a report of all the data in the files which look like
this.
files men women chidden cars dogs
file1 234 112 4 11 0
file2 344 0 34 0 9
that is a table with fields names are columns and file names are
rows, the columns name all possible categories in the files, raw names
the files, a zero where there is no data for that particular field in
any given file.
I was thinking, open files, read data into a map, iterate through the
map, depending on the key, place the value in vector so that we have
vector for men, and another for women,... with the size of "number of
files", then foreach vector<category> (foreach vector<files>) cout
with setw(int) and so forth.
thanks