chavanak has asked for the wisdom of the Perl Monks concerning the following question:
Array1 ATOM 2198 [b]SG CYS L 51[/b] 39.781 -12.827 5.691 1.00 26 +.67 ATOM 2199 N MET L 52 37.845 -15.766 5.722 1.00 33.08 ATOM 2200 CA MET L 52 38.312 -17.144 5.674 1.00 33.08 ATOM 2201 C MET L 52 37.329 -18.022 4.901 1.00 33.08
I am supposed to remove elements from array2 that are not present in array1. But my problem is I have to judge the differences based only on the bold text above. i.e., the perl program should compare both the arrays and if the bold part is common in both files, then it should be removed from array2. I am not understanding how I can tell perl to look only for the bold text and ignore the remaining text and number. Can anyone help me? CheersArray2 ATOM 2212 [b] CB MET L 52[/b] 17.332 94.112 87.029 1.00 0 +.00 ATOM 2213 CG MET L 52 18.017 94.866 88.170 1.00 0.00 ATOM 2214 SD MET L 52 18.711 96.457 87.699 1.00 0.00 ATOM 2215 CE MET L 52 17.198 97.429 87.820 1.00 0.00 ATOM 2216 N ARG L 53 19.331 91.671 87.132 1.00 0.00
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Accessing secondary elements in array
by johngg (Canon) on Nov 04, 2009 at 15:07 UTC | |
|
Re: Accessing secondary elements in array
by JavaFan (Canon) on Nov 04, 2009 at 12:03 UTC | |
by chavanak (Initiate) on Nov 04, 2009 at 12:21 UTC | |
by JavaFan (Canon) on Nov 04, 2009 at 12:30 UTC | |
by chavanak (Initiate) on Nov 04, 2009 at 13:00 UTC | |
by JavaFan (Canon) on Nov 04, 2009 at 13:16 UTC |