Hey guys,
I have the following task:
- Read two files into separate hashes
- Find out duplicates by checking out the common keys (e.g., id)
- Merge those two hashes while keeping only the duplicates and discarding the rest
- Print out the new hash into an output file
Note: Files are not of same size (both in rows and columns), and furthermore they contain multiple values
Problems
- Well, basically everything. But to begin with, I could not figure out how to read files into hashes while keeping all multiple values (It appears to catch one key and one value only) Should I read the all values as an array?
I would appreciate your wisdom. Thanks!
: Thanks everyone! In one of the messages below, GrandFather provides a working code that carries out the task I described in my question.