Re: [Tutor] extracting lines in large file

2009-06-23 Thread Lie Ryan
Bryan Fodness wrote: > tried both again, they both return the same 9 lines, when i expect > 492. it dies on a blank line, but the if i_line takes care of the > previous ones. > Can you give a sample input that should, but not passed by the code? Unrelated Tips: You can rely on python's short-c

Re: [Tutor] extracting lines in large file

2009-06-22 Thread Vince Spicer
are there any extra spaces of characters " intrinsic" !== "intrinsic" On Monday 22 June 2009 8:14:00 pm Bryan Fodness wrote: > tried both again, they both return the same 9 lines, when i expect > 492. it dies on a blank line, but the if i_line takes care of the > previous ones. > > On Mon, Jun 2

Re: [Tutor] extracting lines in large file

2009-06-22 Thread Bryan Fodness
tried both again, they both return the same 9 lines, when i expect 492. it dies on a blank line, but the if i_line takes care of the previous ones. On Mon, Jun 22, 2009 at 4:21 PM, vince spicer wrote: > 14mb file shouldn't be an issue, unless you very little ram, is there any > errors being outpu

Re: [Tutor] extracting lines in large file

2009-06-22 Thread Alan Gauld
"Bryan Fodness" wrote I am trying to output all the lines that start with a specific word. It is a large output file (~14 Mb), but nothing that I thought would be a problem. Shouldn't be, you are processing one line at a time! for line in open('output.new'): i_line = line.split() if

Re: [Tutor] extracting lines in large file

2009-06-22 Thread vince spicer
14mb file shouldn't be an issue, unless you very little ram, is there any errors being outputted? a cleaner way for reading the file: for line in open("output.new"): if line.startswith("intrinsic"): print line On Mon, Jun 22, 2009 at 2:16 PM, Bryan Fodness wrote: > I am trying to o

[Tutor] extracting lines in large file

2009-06-22 Thread Bryan Fodness
I am trying to output all the lines that start with a specific word. It is a large output file (~14 Mb), but nothing that I thought would be a problem. for line in open('output.new'): i_line = line.split() if i_line: if i_line[0] == "intrinsic": print i_line It does no