Relation between class attributes and variables.
Hi guys,
I'm just getting used to OOP and classes etc. I'm really confusing myself.
I have some .csv which contains the column titles (FirstName, SecondName, Address)
I wish to make a class called Person for each row. This would obviously allow me to store Person.FirstName etc.
This bit is fine.
My problem comes because other .csvs have these columns in different order e.g (SecondName, FirstName, Address)
I want to be able to identify which column is "SecondName" e.g Column 1
or 2? and then assign this to the Person class accordingly. I am unsure
of the best way to go about referencing column number and the person
class.
I hope this makes sense and I appreciate all help :)
Many Thanks