[Tutor] Finding items in a list
Emily Patek
Emily_Patek at umit.maine.edu
Fri Feb 24 14:42:11 CET 2006
Hi -
I am trying to break apart a list into several smaller lists based on repeating nearly identical entries. For example, every so often there is the word CLUSTER with a number after it, like CLUSTER 1. I can find them one by one, but would like to
do a while loop for while item in list = CLUSTER X. Is there a key that I can put in that means "any text that comes after" that would go from cluster to cluster without my typing in each cluster and number? I am a very beginner programmer and am
trying to parse a file of gene-related information that is in a not-so-easy format. I put it into a list based on lines through the splitlines() method. I also thought about splitting the text by CLUSTER and then making each item of the list into
a string that I could then split, but couldn't get that to work either...
Thanks!
Emily
More information about the Tutor
mailing list