if ($answer_counter == 1): ?>
endif; ?>
$ perl -pe 's/ILE P/ILEP/; s/^(\s*(\S+\s+){9})\S+/${1}1/ if /^(\s*(\S+\s+){2})(P4|CA)/; s/ILEP/ILE P/' ip.txt
CRYST1 78.428 78.428 78.428 90.00 90.00 90.00 P 1 1
ATOM 1 CI1 JPIPP 1 41.874 78.965 24.633 1.00 0.00 PI C
ATOM 2 CI2 JPIPP 1 41.978 79.560 26.065 1.00 0.00 PI C
ATOM 3 CI3 JPIPP 1 40.811 80.549 26.148 1.00 0.00 PI C
ATOM 4 CI4 JPIPP 1 39.498 79.850 25.983 1.00 0.00 PI C
ATOM 5 O4P JPIPP 1 38.376 80.788 26.069 1.00 0.00 PI O
ATOM 6 P4 JPIPP 1 37.130 80.601 27.002 1.00 1 PI P
ATOM 7 O41 JPIPP 1 37.214 81.710 27.969 1.00 0.00 PI O
ATOM 8 O42 JPIPP 1 35.998 80.809 26.128 1.00 0.00 PI O
ATOM 9 O43 JPIPP 1 37.088 79.268 27.654 1.00 0.00 PI O
ATOM 37 HT3 ILE P 10 13.930 68.062 46.163 1.00 0.00 P1
ATOM 38 CA ILE P 10 15.421 69.513 46.954 1.00 1 P1 C
ATOM 39 HA ILE P 10 14.944 69.690 47.906 1.00 0.00 P1 H
ATOM 40 CB ILE P 10 16.432 68.520 47.458 1.00 0.00 P1 C
- tem pré-processo e pós-processamento para lidar com
ILE P
na quarta coluna
-
s/^(\s*(\S+\s+){9})\S+/${1}1/
mudará o valor da 10ª coluna para 1
-
/^(\s*(\S+\s+){2})(P4|CA)/
corresponderá a P4
ou CA
na terceira coluna