On Thu, Jan 28, 2010 at 07:07:04AM -0800, evilweasel wrote: > Hi folks, > > I am a newbie to python, and I would be grateful if someone could > point out the mistake in my program. Basically, I have a huge text > file similar to the format below: > > AAAAAGACTCGAGTGCGCGGA 0 > AAAAAGATAAGCTAATTAAGCTACTGG 0 > AAAAAGATAAGCTAATTAAGCTACTGGGTT 1 > AAAAAGGGGGCTCACAGGGGAGGGGTAT 1 > AAAAAGGTCGCCTGACGGCTGC 0
I know this is a python list but if you really want to get the job done quickly this is one method without writing python code: $ cat /tmp/y AAAAAGACTCGAGTGCGCGGA 0 AAAAAGATAAGCTAATTAAGCTACTGG 0 AAAAAGATAAGCTAATTAAGCTACTGGGTT 1 AAAAAGGGGGCTCACAGGGGAGGGGTAT 1 AAAAAGGTCGCCTGACGGCTGC 0 $ grep -v 0 /tmp/y > tmp/z $ cat /tmp/z AAAAAGATAAGCTAATTAAGCTACTGGGTT 1 AAAAAGGGGGCTCACAGGGGAGGGGTAT 1 Regards Johann -- Johann Spies Telefoon: 021-808 4599 Informasietegnologie, Universiteit van Stellenbosch "My son, if sinners entice thee, consent thou not." Proverbs 1:10 -- http://mail.python.org/mailman/listinfo/python-list