in reply to Replacing characters in a line
Hi, just try this,
$string='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'; $string=~s#((\w+) \d{4} \w TYR )D#$1X#gsi; print $string; output: ******* ATOM 3316 N TYR X 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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Replacing characters in a line
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 |