strip part of string

Francesco Pietra chiendarret at gmail.com
Sun May 10 11:18:51 EDT 2009


Hi:
I would like to delete everything from column 54 on for each line
beginning with "ATOM". In the example in the attachment (sorry for the
attachment; I found no way with Google mail to have plain text mail)
the new line would become:

ATOM     49  NH1 ARG    84      84.628  41.570  44.395

without any blank space to the right. . Everything else should remain
at its original column. I have been looking for ???? statement, unable
(my big fault ) to find a right one. I tried with slices % but it
becomes unnecessarily complex.


Thanks
francesco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strip_string.py
Type: text/x-python
Size: 403 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090510/5bc24018/attachment.py>


More information about the Python-list mailing list