annakarenina83 has asked for the wisdom of the Perl Monks concerning the following question:
I'm a humble biologist who has just started to learn Perl (using Sam's 21 days book - I'm only on day seven!) and I need some help with a specific aspect of a script I'm trying to write (just a push in the right direction will do)
Briefly - I need to take two txt files, each with a list of names. There is some redundancy across these two lists (i.e some names appear in both lists) and that is the problem. I need to extract the names from both files (I think I know how to do this - I was just going to put the list of names from each file into two arrays, respectively)and then compare the elements of the arrays and somehow then output a file where it lists each name from both arrays only once (i.e remove the redundancy where a given name appears in both files). The part I need help with is which function/s I could use to only list the names that appear in both lists once (and also include the names that appear in only one of the lists). I hope that was clear.Any help or a hint would be greatly appreciated. Cheers, Anna
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help with a function that will cut out redundancy across two lists
by wind (Priest) on May 20, 2011 at 05:11 UTC | |
|
Re: help with a function that will cut out redundancy across two lists
by Utilitarian (Vicar) on May 20, 2011 at 05:34 UTC | |
|
Re: help with a function that will cut out redundancy across two lists
by ww (Archbishop) on May 20, 2011 at 11:34 UTC | |
|
Re: help with a function that will cut out redundancy across two lists
by dorko (Prior) on May 20, 2011 at 13:48 UTC | |
|
Re: help with a function that will cut out redundancy across two lists
by Plankton (Vicar) on May 20, 2011 at 07:00 UTC |