I have two files Persons.txt and Hobby.txt.In the third file i want to put all the persons names and add each name some hobbies.This is how my files look like
Persons.txt
ID;NUME;PRENUME;DATA_NASTERII;PROFESIA
1;Stan;Ilie;22-01-1977;profesor;
2;Becali;GG;01-07-1965;patron;
3;Tanase;Cristian;07-12-1988;fotbalist;
4;Pop;Ion;21-03-1984;pictor;
5;Popescu;Rodica;17-04-1986;sculptor;
Hobby.txt
ID;NUME;DESCRIERE;NUMAR_MINIM_PERSOANE;ELEMENT_NECESAR
1;baschet;sport in care se arunca mingea la cos;6;minge
2;fotbal;sport in care nue voie sa atingi mingea cu mana in care trebuei sa inscrii in poarta adversa;14;minge
3;chitara;cantatul la chitara;1;chitara
4;pianul; cantatul la pian;1;pian
5;programarea;scrierea de programe software;1;PC
I need a third file that looks like this:
Ion Pop : baschet, volei
Ilie Stan: steaua, handbal
The problem is that i don't know how to get the persons name and how to append to them 2 or three hobbies.i have no idea how to split each line from the file and write to the third file