[Tutor] map one file and print it out following the sequence

lina lina.lastname at gmail.com
Wed Sep 28 05:34:46 CEST 2011


Hi,

Thanks for both of your reply.

File 1 is:

     3         C     1  CUR     C19     1    0.200  12.0110
     4       CR1     1  CUR     C20     1   -0.060  12.0110
     5        HC     1  CUR     H20     1    0.060   1.0080

File 2 is:
ATOM      2  H20 CUR     1      30.338  28.778  -6.812  1.00  0.00

ATOM      4  C20 CUR     1      31.394  28.922  -7.039  1.00
0.00
ATOM      5  C19 CUR     1      31.790  29.357  -8.323  1.00  0.00

I wish to get:

ATOM      5  C19 CUR     1      31.790  29.357  -8.323  1.00
0.00
ATOM      4  C20 CUR     1      31.394  28.922  -7.039  1.00
0.00
ATOM      2  H20 CUR     1      30.338  28.778  -6.812  1.00  0.00


The dictionary is C19 C20 H20 sequence read from file 1 field 5.
rearrange the file 2 field 3 following the sequence of C19, C20, H20.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110928/db21dc14/attachment-0001.html>


More information about the Tutor mailing list