Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Comparing strings from different files (merge)

by tye (Sage)
on Oct 08, 2013 at 19:54 UTC ( #1057454=note: print w/replies, xml ) Need Help??

in reply to Comparing strings from different files

The suggestions to use a hash don't seem sound to me as it looks like you have plenty of records with duplicate "labels". But perhaps there is a unique identifier in there that you are aware of but haven't clearly told us about and a hash would work (if the files easily fit in RAM).

I would instead sort each file and then do a classic "merge" algorithm between the two sorted files. How to sort the files will require more knowledge about the structure and content than I can deduce from just the example data you have posted.

- tye        

  • Comment on Re: Comparing strings from different files (merge)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2016-10-25 12:08 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (317 votes). Check out past polls.