Re: Python editing .txt file

2010-06-16 Thread 187braintrust
> > From: MRAB > To: python-list@python.org > Date: Wed, 16 Jun 2010 03:06:58 +0100 > Subject: Re: Python editing .txt file > 187braintr...@berkeley.edu wrote: > >> I am trying to write a program in Python that will edit .txt log files >> that contain regression output from R. Any thoughts or sug

Re: Python editing .txt file

2010-06-16 Thread 187braintrust
MRAB mrabarnett.plus.com> writes: > input_file = open(input_path) > output_file = open(output_path, "w") > for line in input_file: > if line.startswith("factor("): > open_paren = line.find("(") > close_paren = line.find(")") > variable = line[open_paren + 1 : close_

Python editing .txt file

2010-06-15 Thread 187braintrust
I am trying to write a program in Python that will edit .txt log files that contain regression output from R. Any thoughts or suggestions would be greatly appreciated. To get an idea of what I am trying to do, note that I include fixed effects in the R regressions, resulting in hundreds of extra