good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
XML File Creation in Perlby documents9900 (Initiate) |
on Apr 16, 2013 at 13:02 UTC ( [id://1028909]=perlquestion: print w/replies, xml ) | Need Help?? |
documents9900 has asked for the wisdom of the Perl Monks concerning the following question:
My First input file is
My second input file is My third input file is
Basically File representation is : 1) First file represents the old and new values. First is root table, Second is actual table in which diff is there. Third column tells the key value. Fourth and Fifth represents old and new value. 2) Second file represents the primary key which exists in db1 only and not in db2. First is root table, Second is actual table in which key exists. Third column tells the key value 3) Third file represents the primary key which exists in db2 only and not in db1. First is root table, Second is actual table in which key exists. Third column tells the key value The output to be created in xml format asTHIS IS NOT COMPLETE OUTPUT. PART OF OUTPUT IS DISPLAYED Can anyone suggest what would be the best way to do this. Should i convert this text file to hash of hashes first and then try using pltoxml(). does this make sense. Can XML::Simple or XML::Writer suffice this. This is the first time I am working on xml and not sure which approach will help efficicently my solution. A small example wrt to my req would be appreciated. *Input file will always be sorted on Root and then TBLNAMEOutput format : Output contains for every root, every table in that root and that for every table, key which exists in one and then key which exists in second only. This comes in section new1 and new2 respectively. Third section contains Modified which needs to read from first input file and list the key value and with that key value what columns are modified (their old and new value) If I have to use XML::Simple, how do i create hashref from these files which i can pass it to XMLout. There is no key in any of these files.I wrote a small piece of code which reads eah root from file1 and from that root reads all files and manually create the tags. Basically i tried creating my own XML parser.
Back to
Seekers of Perl Wisdom
|
|