Hello All,
Let me says that I have Mapping.xml file like this
<ColumnName Mapping="HELLO LOOK FOR ME 1">COLUMNVALUE1</ColumnName>
<ColumnName Mapping="HELLO LOOK FOR ME 2">COLUMNVALUE2</ColumnName>
And I have a Data.csv file like this:
"HELLO LOOK FOR ME 1", "HELLO LOOK FOR ME 2", "I AM NOT IN MAPPING 1" ,"I AM NOT IN MAPPING 2"
467898, 4786, 222323, 4687327
Requirement is
1) Write a C# Code to Parse the Mapping.xml
2) Map the COLUMNNAME to the Value, Against Mapping attribute defined in the XML. In our case "HELLO LOOK FOR ME 1"
So the End Result should be having a C# Object holding the values.
COLUMNVALUE1 = 467898
COLUMNVALUE2 = 4786
3) Latter if I wish to Included Third Column, I have to just edit the XML File Mapping.xml
<ColumnName Mapping="HELLO LOOK FOR ME 1">COLUMNVALUE1</ColumnName>
<ColumnName Mapping="HELLO LOOK FOR ME 2">COLUMNVALUE2</ColumnName>
<ColumnName Mapping="I AM NOT IN MAPPING 1">COLUMNVALUE3</ColumnName>
So that after the modification I should have a Object in C# having value
COLUMNVALUE1 = 467898
COLUMNVALUE2 = 4786
COLUMNVALUE3 = 222323
Is this possible with C#
Kindly note, I know how to parse read/write an XML file and also Parse the CSV Files. via C#
But the problem, here is I am looking for a Technique in C# that would suit my requirements.
If anyone know or have some idea kindly let me know
Thanks and Regards
Durai Velan C