[Tutor] raw_input()
kumar s
ps_python at yahoo.com
Tue Mar 16 00:04:02 CET 2010
Here it worked after trying a while loop:
x1.py =
while True:
second = raw_input()
x = second.split('\t')
y = x[1:]
print '\t'.join(y)
%cat mybigfile.rod | python x1.py
Traceback (most recent call last):
File "x1.py", line 2, in <module>
second = raw_input()
EOFError: EOF when reading a line
How to notify that at EOF break and suppress exception.
thanks
----- Original Message ----
From: kumar s <ps_python at yahoo.com>
To: tutor at python.org
Sent: Mon, March 15, 2010 6:52:26 PM
Subject: [Tutor] raw_input()
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.
_______________________________________________
Tutor maillist - Tutor at python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list