in reply to Difficulty Mapping Data
I am trying to make sure that all host-aliases that exist in file1 also exist in file2.
Put differently, you want to know if there's a host-alias in file1 that doesn't exist in file2. (It's often convenient to convert questions that use "all" into questions that use "each".)
Load up the host-aliases from file2. Store them in a hash keyed by the host-alias for ease of lookup. The value doesn't matter. (I'd use something true like 1.)
Then iterate through the host-alias in file 1. For each host-alias you find in file1, check if it's in file2 (by checking if it's in the hash).
You can stop iterating as soon as you find one that's missing and still satisfy your spec, but you might want to continue iterating to find all the missing host-aliases.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Difficulty Mapping Data
by walkingthecow (Friar) on Sep 07, 2010 at 20:22 UTC | |
by ikegami (Patriarch) on Sep 07, 2010 at 20:48 UTC | |
by ikegami (Patriarch) on Sep 08, 2010 at 02:29 UTC |