Becky has asked for the wisdom of the Perl Monks concerning the following question:
ATOM 3316 N TYR D 24 97.479 18.805 2.990 1.00 36.32 D N ATOM 3322 CD1 TYR D 24 96.225 15.974 2.812 1.00 17.96 D C
I need to replace the 2 lone D characters in each line with an X. I DON'T want to replace thd D in CD1. Whatever regex I do I seem to replace the D in CD1 or muck up the formatting of the line, which must stay the same. Can you help? Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing characters in a line
by pelagic (Priest) on Mar 04, 2005 at 11:49 UTC | |
|
Re: Replacing characters in a line
by holli (Abbot) on Mar 04, 2005 at 11:50 UTC | |
|
Re: Replacing characters in a line
by monkey_boy (Priest) on Mar 04, 2005 at 13:52 UTC | |
|
Re: Replacing characters in a line
by sh1tn (Priest) on Mar 04, 2005 at 15:52 UTC | |
|
Re: Replacing characters in a line
by perlsen (Chaplain) on Mar 04, 2005 at 12:39 UTC | |
by holli (Abbot) on Mar 04, 2005 at 12:45 UTC | |
by manav (Scribe) on Mar 04, 2005 at 13:19 UTC | |
by holli (Abbot) on Mar 04, 2005 at 13:32 UTC | |
by pelagic (Priest) on Mar 04, 2005 at 13:23 UTC | |
|
Re: Replacing characters in a line
by Taulmarill (Deacon) on Mar 04, 2005 at 14:36 UTC | |
by monkey_boy (Priest) on Mar 04, 2005 at 14:45 UTC |