Thank you for the tips so far guys, I can definitely stop feeling stuck now :-)

When posting this question I forgot it might actually help for getting the most specific advise if I'd add some snippets of the files used, so here they are

what the .xml-files look like:

<contractor customergroup="PAR"> <person> <firstname>Julie</firstname> <name>Keppen</name> <sex>F</sex> <birthdate></birthdate> <phone>0485651115</phone> <email>juliekeppen@gmail.com</email> </person> </contractor>

What the .txt-file looks like:

FirstName Julie LastName Keppen Email juliekeppen@gmail +.com BirthDate 1987-11-11 FirstName Amaury LastName Reinquin Email a.reinquin@out +look.com BirthDate 1991-08-24 FirstName Pierre LastName Vaucamps Email pierre.vaucamp +s@gmail.com BirthDate 1988-11-26 FirstName Stephanie-Katrien LastName Eggermont-Witpas Emai +l eggermont.st@gmail.com BirthDate 1900-01-01

I have just changed the query to output this result in a more readable way:

Julie;Keppen;juliekeppen@gmail.com;1987-11-11 Amaury;Reinquin;a.reinquin@outlook.com;1991-08-24 Pierre;Vaucamps;pierre.vaucamps@gmail.com;1988-11-26 Stephanie-Katrien;Eggermont-Witpas;eggermont.st@gmail.com;1900-01-01

My gut tells me this last version might be easier when working with hashes.

Have looked up stuff on hashes but it is not clear to me how to use them in this assignment, every time I read something on hashes, the first thing they do is store specific strings in them like this:

%HoA = ( flintstones => [ "fred", "barney" ], jetsons => [ "george", "jane", "elroy" ], simpsons => [ "homer", "marge", "bart" ], );

This is not very helpful to me, I'm not going to manually type in all names, may aswell manually look up the bdates and copy-paste them in the .xml then. But of course, I know I'm missing something essential in the explanation given about the hashes. Just don't know what.


In reply to Re: Matching specific strings (are subs a good idea?) by zarath
in thread Matching specific strings (are subs a good idea?) by zarath

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.