Need help with a program

Johann Spies jspies at sun.ac.za
Fri Jan 29 04:23:54 EST 2010


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 



More information about the Python-list mailing list