grashoper has asked for the wisdom of the Perl Monks concerning the following question:

I have a list of accounts populated from a db, I want to verify the account descriptions match a masterlist I obtained from my QA department, I would like to do this programmatically so that if a value exists in both documents it replaces the friendly name of the account in the dbfile with the one in the master. Both files are xml documents. Example of master.xml format followed by example of sitecode.xml file. Specifically looking to replace sitecode with mlsname from master.xml.
<STATE statename="Alberta"> <MLS mlscode="ALB" mlsname="Alberta Residential MLS System" city +="Calgary and Edmonton" mlsserver="abmls.mlxchange.com" mlsemail="abm +ls.mlxchange.com"/> <MLS mlscode="CLS" mlsname="Canadian Commercial Listing Service" + city="Alberta and B.C." mlsserver="cls.mlxchange.com" mlsemail="cls. +mlxchange.com"/> </STATE> <STATE statename="Arizona"> <MLS mlscode="ARM" mlsname="Arizona Regional MLS System" city="P +hoenix" mlsserver="armls.mlxtempo.com" mlsemail="armls.mlxtempo.com" +tempo="1"/> </STATE>
<sSelect> <!--cached--> <site code="" name="Select your MLX Site" /> <site code="ALB" name="Alberta Residential MLS System" /> <site code="AAR" name="Ann Arbor Area Board of Realtors" /> </sSelec +t>
  • Comment on compare 2 files and if an entry exists in one swap it with the description in the other
  • Select or Download Code

Replies are listed 'Best First'.
Re: compare 2 files and if an entry exists in one swap it with the description in the other
by apl (Monsignor) on Jan 24, 2008 at 19:02 UTC
    Okay. Show us the code you've written, describe the problem you had implementing it, and we'll be glad to help...
Re: compare 2 files and if an entry exists in one swap it with the description in the other
by roboticus (Chancellor) on Jan 25, 2008 at 04:37 UTC
    grashoper:

    Hmmm....I know this doesn't answer the question you asked, but shouldn't you really just put the QA department's master list into a table and just let the database do the work?

    update work_table set name=QA.name from work_table W join quality_assurance QA on W.ID=QA.ID where W.name<>QA.name
    ???

    ...roboticus