Why you read it in completely in the first place when you want to operate on 
lines? When you mystring.split('n') you double the amounth of memory used. For 
small files this seems ok but for larger ones your programm could explode. It's 
much better to use the splitLines iterator as Stefan_Salewski pointed out. This 
way you only have to store the current line in memory. 

Reply via email to