Re: NewB question on text manipulation

2006-05-03 Thread ProvoWallis
Thanks again and sorry about the lack of examples. It didn't even occur to me that my example wasn't comprehensive enough when I posted my first message but I can see the issue now. Your solution is really helpful for me to see. I can't tell you how much I apprecaite it. I thought that adding more

Re: NewB question on text manipulation

2006-05-03 Thread Steve R. Hastings
On Wed, 03 May 2006 10:29:55 -0700, ProvoWallis wrote: > I only have one issue that I can't figure out. When I print the new > string I'm getting all of the values in the lt list rather than just > the one that corresponds to the original entry. I did not realize that each entry would have its own

Re: NewB question on text manipulation

2006-05-03 Thread ProvoWallis
Thanks very much for this I really appreciate it. I've pasted what I've got now thanks to you. I only have one issue that I can't figure out. When I print the new string I'm getting all of the values in the lt list rather than just the one that corresponds to the original entry. E.g., My origina

Re: NewB question on text manipulation

2006-05-02 Thread Steve R. Hastings
On Tue, 02 May 2006 22:37:04 -0700, ProvoWallis wrote: > I have a file that looks like this: > > APPEAL40-24; 40-46; 42-46; 42-48; 42-62; 42-63 PROC > GUIDE921(b)(1) > > (i.e., <[chapter name][multiple or single book page > ranges][chapter name][multiple or single book page > ranges][code] > > b

NewB question on text manipulation

2006-05-02 Thread ProvoWallis
I'm totally stumped by this problem so I'm hoping someone can give me a little advice or point me in the right direction. I have a file that looks like this: APPEAL40-24; 40-46; 42-46; 42-48; 42-62; 42-63 PROC GUIDE921(b)(1) (i.e., <[chapter name][multiple or single book page ranges][chapter nam

Re: text manipulation

2005-12-16 Thread BartlebyScrivener
John, Martin is right. Always try to solve without regex first. However, for those situations where you definitely need regex, use this tutorial: http://www.amk.ca/python/howto/regex/ It's well-written, succinct, and Python-specific. rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: text manipulation

2005-12-16 Thread Juho Schultz
Johhny wrote: > Hello, > > I am trying to write a script in python (to replace a perl script with > limited functionality). Now I have some issues. Currently I am using > the perl to load the file then regex parse certain lines to remove > characters (uncomment lines and change variables). I would

Re: text manipulation

2005-12-16 Thread Martin Franklin
Martin Franklin wrote: > Johhny wrote: > >>Hello, >> >>I am trying to write a script in python (to replace a perl script with >>limited functionality). Now I have some issues. Currently I am using >>the perl to load the file then regex parse certain lines to remove >>characters (uncomment lines an

Re: text manipulation

2005-12-16 Thread Martin Franklin
Johhny wrote: > Hello, > > I am trying to write a script in python (to replace a perl script with > limited functionality). Now I have some issues. Currently I am using > the perl to load the file then regex parse certain lines to remove > characters (uncomment lines and change variables). I would

Re: text manipulation

2005-12-16 Thread Isaac T Alston
Johhny wrote: > Any advice would be great. Have you had a look at Python's re module? If you've not, I suggest you do so - it contains all of Python's regex tools which you'll need. Regards, -- Isaac -- http://mail.python.org/mailman/listinfo/python-list

text manipulation

2005-12-16 Thread Johhny
Hello, I am trying to write a script in python (to replace a perl script with limited functionality). Now I have some issues. Currently I am using the perl to load the file then regex parse certain lines to remove characters (uncomment lines and change variables). I would like to take that into th