On Sun, 10 May 2009 17:18:51 +0200, Francesco Pietra wrote: > 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
if line.startswith("ATOM"): line = line[0:54].rstrip() should do what you want. -- Steven -- http://mail.python.org/mailman/listinfo/python-list