Re: Python editing .txt file

2010-06-16 Thread MRAB
[email protected] wrote: From: MRAB mailto:[email protected]>> To: [email protected] <mailto:[email protected]> Date: Wed, 16 Jun 2010 03:06:58 +0100 Subject: Re: Python editing .txt file [email protected] <ma

Re: Python editing .txt file

2010-06-16 Thread 187braintrust
> > From: MRAB > To: [email protected] > Date: Wed, 16 Jun 2010 03:06:58 +0100 > Subject: Re: Python editing .txt file > [email protected] wrote: > >> I am trying to write a program in Python that will edit .txt log files >> that contain regressio

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_

Re: Python editing .txt file

2010-06-15 Thread Terry Reedy
On 6/15/2010 9:28 PM, [email protected] 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 suggestions would be greatly appreciated. I once wrote programs (in C, Python should be easier) to process bmdp

Re: Python editing .txt file

2010-06-15 Thread MRAB
[email protected] 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 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 regr

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