The stupid question is the question not asked | |
PerlMonks |
Comparing two XML files with XML::Simple using FOREACH and IF usingby gr.d (Novice) |
on Jan 13, 2016 at 05:59 UTC ( [id://1152628]=perlquestion: print w/replies, xml ) | Need Help?? |
gr.d has asked for the wisdom of the Perl Monks concerning the following question: Hello Monks, So I earlier posted a similar unclear question to which I was not able to understand the answer. I have a STANDARD.XML and I have separated them into two XML files because as a single file, they were inconsistent with the data that I'm trying to parse. Let's say they are TOP.XML and LOWER.XML. Now I'm trying to stores these files in an array and compare them.How can one store the entire file in an array? By separating the XML files I have tried to fetch the attributes values separately from each of the XML files and write them to a single output file, Now I have to compare the two XML files and declare, (i.e.) Hint:"foreach of the LOWER.XML data, if the data "NOT" present in TOP.XML, then it can be declared as the output or written into that single file" Does it mean I have to again create another file and write them into that and move it back to original file, if that's how it's written, how to move them to a original file? My snippet would look something like the below
I'm using XML::Simple part, though he's not the right one, currently I have gone almost the whole way with it, just a little bit more! Thanks!
Back to
Seekers of Perl Wisdom
|
|