Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Compare Two Files, Merge Updates from One File to the Other

by graff (Chancellor)
on May 04, 2009 at 06:04 UTC ( [id://761663]=note: print w/replies, xml ) Need Help??


in reply to Compare Two Files, Merge Updates from One File to the Other

This is just another case of using a HoH to do the equivalent of an sql "join" on two tables. You should be familiar with the approach by now, so there's no need for folks here to write the code for you again.

(Of course, you can also restructure the data into RDB tables and use sql to do the join -- same result, and same response: a suitable solution has already been posted at the monastery within the last few days, and it's just a matter of turning the crank.)

(update: I mention HoH because I assume that the two input files contain data for more than one individual -- the first-layer hash keys are individual ID's and the second-layer keys are the field names and values for the data pertaining to each individual.)

  • Comment on Re: Compare Two Files, Merge Updates from One File to the Other

Replies are listed 'Best First'.
Re^2: Compare Two Files, Merge Updates from One File to the Other
by rycher (Acolyte) on May 04, 2009 at 12:30 UTC
    Hello, Thank you for the advice. I've done a fairly intricate series of SQL inner joins and aliases to have a Cartesian set of data match points into a csv exported file. I also know how to open two files and write into one.

    I will look into the hash of hashes method to insert data into the LDIF formatted file. I have a similar routine in a previous script and what you said about the first layer & second layer keys make sense. Thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://761663]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-20 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found