Re: Strip lines from files

2008-01-10 Thread Caleb
Francesco Pietra wrote: > I am posting again as previous identical message had alleged suspicious > header. > > I used successfully script > > f=open("prod1-3_no_wat_pop.pdb", "r") > for line in f: > line=line.rstrip() > if "WAT" not in line: > print line > f.close() l

Re: Strip lines from files

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 09:40], Francesco Pietra ([EMAIL PROTECTED]) wrote: >A variant need has now emerged, to perform the same task from a very long >series of shorter files trp.pdb.1, trp.pdb.2 ,. Could you see how to adapt >the above script to the new need? Look at sys.argv and pass the list of fil

Strip lines from files

2008-01-08 Thread Francesco Pietra
I am posting again as previous identical message had alleged suspicious header. I used successfully script f=open("prod1-3_no_wat_pop.pdb", "r") for line in f: line=line.rstrip() if "WAT" not in line: print line f.close() to strip lines containing the word WAT fro