|I've somehow managed to obtain lists of people's names.|
These names where read this way
Status #for instance Sir., Mr., Eng., Doc. ... etc.
Name(s) #in case of multiple names, they are listed on different lines, not the same
These words were gradually attached to a file during the precedent "for loop".
Now i have a file witch is full of names, surnames, and statuses, sorted in the order they were grabbed.
I now have to split the data contained in the file by dividing it in contacts in the following form:
Status\tName(1)\t...\tName(n)\Surname\n #\t stands for tab and \n for newline of course
This means i have to make my script recognise where the "Statuses" are located (they're the only fields always made by 2 to 3 chars), store that line in the satus field, then look for the following occourrence of a status in the list and store everything that there's between as names until the last line before the next occourrence of a status, which will be stored in the Surname field. And pass to the next contact. Until EOF.
I'm pretty confused. I got the concept (and wish you understood me expressing it as well) but have no idea how to concretizing, except from trying cat loops with counters within cat loops with counters within cat loops with counters...but i'm getting pretty mad.