Thanks for that Richard and Steve! Below is my full code so far:
for line in file: if line.startswith("1"): a.write(line) elif line.endswith("0"): lists_a = line.strip().split() print lists_a elif line.startswith("2"): lists_b = line.strip().split() print list_a Essentially, I want to read in a file and depending on location of 0, 1, 2, write to another file or create lists. The above passes without error warning but does nothing (semantic error?). Any Suggestions? Thanks in advance, Seafoid. -- View this message in context: http://old.nabble.com/Line-indexing-in-Python-tp26845253p26846049.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list