[Tutor] raw_input()

kumar s ps_python at yahoo.com
Mon Mar 15 23:52:26 CET 2010


Dear group:
I have a large file 3GB. Each line is a tab delim file. 

example lines of it:

585     chr1    433     433     rs56289060      0       +       -       -       -/C     genomic insertion       unknown 0       0       unknown between 1
585     chr1    491     492     rs55998931      0       +       C       C       C/T     genomic single  unknown 0       0       unknown exact   1
585     chr1    518     519     rs62636508      0       +       G       G       C/G     genomic single  unknown 0       0       unknown exact   1
585     chr1    582     583     rs58108140      0       +       G       G       A/G     genomic single  unknown 0       0       unknown exact   1

Now I dont want to load this entire file. I want to give each line as an input and print selective lines. 

For example:

x1.py  = 

second = raw_input()
x =  second.split('\t')
y = x[1:]
print '\t'.join(y)


%cat mybigfile.rod | python x1.py
chr1    433     433     rs56289060      0       +       -       -       -/C     genomic insertion       unknown 0       0       unknown between 1


My question:

this program is only printing first line. It is not processing every line that cat spits to x1.py. 
how do I print every line. 

thanks
Kumar.



      



More information about the Tutor mailing list