> f = open("/tmp/data.txt", 'w') > > will open that file. > > You can throw the first line away with > > headings = f.next() > > Then you can loop over the rest with > > for name, aa, topo, access, dssp, stride, z in file: > # > # Then process each line here
Small caveat here...Steve changed file-variables on you here, and assumed a tuple-unpacking that won't work. You'll want something like for line in f: (name, aa, topo, access, dssp, stride, z) = ( line.rstrip('\n').split('\t') # process the line here I don't know how your fields are delimited, whether by spaces or tabs. In the above code, I split by tabs, but you can just use .split() if it should be split on any white-space. It's a bit more complex if you need to split by column-offsets. -tkc -- http://mail.python.org/mailman/listinfo/python-list