in reply to Matching specific strings (are subs a good idea?)
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching specific strings (are subs a good idea?)
by choroba (Cardinal) on Sep 08, 2017 at 08:23 UTC | |
|
Re^2: Matching specific strings (are subs a good idea?)
by poj (Abbot) on Sep 08, 2017 at 08:11 UTC |