Skip to main content
added 1 character in body; added 54 characters in body
Source Link
Jimmy
  • 109
  • 1
  • 10

I want to run a c++ program to process a lot of data from different xml files and output results. I run the program once per file and potentially have around 50 different files.

The trouble is each xml file has different naming convention for the nodes, for example:

A.xml

 
<entry>
    <id><![CDATA[9]]></id>
    <description><![CDATA[Dolce 27 Speed]]></description>
 </entry>

B.xml

<item>
    <uuiid><![CDATA[9]]></uuid>
    <content><![CDATA[Dolce 27 Speed]]></content>
 </item>

What is the appropriate way to define these mappings, so when I run the program the software knows what data is in what tags, so I can store the id, description etc together no matter what the input tags are.

Ideas I have so far are:

A) Start the program with flags (in the real program there will be 10 mappings so could get messy), I.e ./main --id uuid --description content

B) Put them in a map and refer to that at start up (any suggestions on how to do the map would be great), I.e ./main --map example1

C) None of the above

I want to run a c++ program to process a lot of data from different xml files and output results. I run the program once per file and potentially have around 50 different files.

The trouble is each xml file has different naming convention for the nodes, for example:

A.xml

 

B.xml

<item>
    <uuiid><![CDATA[9]]></uuid>
    <content><![CDATA[Dolce 27 Speed]]></content>
 </item>

What is the appropriate way to define these mappings, so when I run the program the software knows what data is in what tags, so I can store the id, description etc together no matter what the input tags are.

Ideas I have so far are:

A) Start the program with flags (in the real program there will be 10 mappings so could get messy), I.e ./main --id uuid --description content

B) Put them in a map and refer to that at start up, I.e ./main --map example1

C) None of the above

I want to run a c++ program to process a lot of data from different xml files and output results. I run the program once per file and potentially have around 50 different files.

The trouble is each xml file has different naming convention for the nodes, for example:

A.xml

<entry>
    <id><![CDATA[9]]></id>
    <description><![CDATA[Dolce 27 Speed]]></description>
 </entry>

B.xml

<item>
    <uuiid><![CDATA[9]]></uuid>
    <content><![CDATA[Dolce 27 Speed]]></content>
 </item>

What is the appropriate way to define these mappings, so when I run the program the software knows what data is in what tags, so I can store the id, description etc together no matter what the input tags are.

Ideas I have so far are:

A) Start the program with flags (in the real program there will be 10 mappings so could get messy), I.e ./main --id uuid --description content

B) Put them in a map and refer to that at start up (any suggestions on how to do the map would be great), I.e ./main --map example1

C) None of the above

Source Link
Jimmy
  • 109
  • 1
  • 10

Run a c++ program under lots of different data maps

I want to run a c++ program to process a lot of data from different xml files and output results. I run the program once per file and potentially have around 50 different files.

The trouble is each xml file has different naming convention for the nodes, for example:

A.xml

B.xml

<item>
    <uuiid><![CDATA[9]]></uuid>
    <content><![CDATA[Dolce 27 Speed]]></content>
 </item>

What is the appropriate way to define these mappings, so when I run the program the software knows what data is in what tags, so I can store the id, description etc together no matter what the input tags are.

Ideas I have so far are:

A) Start the program with flags (in the real program there will be 10 mappings so could get messy), I.e ./main --id uuid --description content

B) Put them in a map and refer to that at start up, I.e ./main --map example1

C) None of the above