Re: [Tutor] Using Python and Regex

2014-08-11 Thread Alan Gauld
On 11/08/14 08:56, Bill wrote: Just a wee point I noticed: def traverse_dirs(wdir): grabline = 0 for f in os.listdir('.'): if os.path.isfile(f) == True: if "Email Exceeded Maximum Size Limit" in f: continue Note that this checks whether the str

Re: [Tutor] Using Python and Regex

2014-08-11 Thread Peter Otten
Bill wrote: > Thanks for yoru reply. This was my first attempt,when running through > idleid get the following error:- > > > Traceback (most recent call last): > File "C:\Users\Bill\Desktop\TXT_Output\email_extraction_script.py", line > 27, in > traverse_dirs(working_dir) > File "C:\Use

Re: [Tutor] Using Python and Regex

2014-08-11 Thread Bill
riginal Message- From: Tutor [mailto:tutor-bounces+bill5work=outlook@python.org] On Behalf Of Bill Sent: 10 August 2014 12:31 To: tutor@python.org Subject: [Tutor] Using Python and Regex Hi, I'm relatively new to Python and I'm trying to write a script to iterate through

Re: [Tutor] Using Python and Regex

2014-08-10 Thread Alex Kleider
On 2014-08-10 04:30, Bill wrote: Hi, I'm relatively new to Python and I'm trying to write a script to iterate through a series of text files in folder searching for some specific text and write it to a CSV. I plan to use Regex to match the text and I have already identified the Regex to do this

Re: [Tutor] Using Python and Regex

2014-08-10 Thread Alex Kleider
On 2014-08-10 08:58, Joel Goldstick wrote: You need to look at os.walk: https://docs.python.org/2/library/os.html#os.walk is os.path.walk depricated? https://docs.python.org/2/library/os.path.html ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] Using Python and Regex

2014-08-10 Thread Joel Goldstick
On Sun, Aug 10, 2014 at 7:30 AM, Bill wrote: > > Hi, > > I'm relatively new to Python and I'm trying to write a script to iterate > through a series of text files in folder searching for some specific text > and write it to a CSV. > > I plan to use Regex to match the text and I have already identi

[Tutor] Using Python and Regex

2014-08-10 Thread Bill
Hi, I'm relatively new to Python and I'm trying to write a script to iterate through a series of text files in folder searching for some specific text and write it to a CSV. I plan to use Regex to match the text and I have already identified the Regex to do this. I've also got as far as cre