Re: [Tutor] Space the final frontier

2006-04-05 Thread Alan Gauld
> Thanks for the prompt replies. I have now processed my file with 999 > lines > and it took seconds. It was beautiful. Glad it works, a couple of tweaks: > filename = "a:/calllist.csv" > filename2 = "c:/calllist.csv" > import string > import os You don't use os or string so don't need to imp

Re: [Tutor] Space the final frontier!

2006-04-05 Thread János Juhász
ell on so small files. Yours sincerely, __ János Juhász > Message: 2 > Date: Tue, 4 Apr 2006 22:33:18 +0100 > From: "John Corry" <[EMAIL PROTECTED]> > Subject: [Tutor] Space the final frontier! > To: > Message-ID: <[EMAIL PROTECTED]> > Content-Type: tex

Re: [Tutor] Space the final frontier

2006-04-05 Thread Kent Johnson
John Corry wrote: > Your advice was spot on. I have enclosed the code that I ended up with. > Instead of appending it to a list, I just wrote it to another file in the > corrected format. A few notes below: > > > filename = "a:/calllist.csv" > filename2 = "c:/calllist.csv" > import string > imp

[Tutor] Space the final frontier

2006-04-05 Thread John Corry
Dear All, Thanks for the prompt replies. I have now processed my file with 999 lines and it took seconds. It was beautiful. Your advice was spot on. I have enclosed the code that I ended up with. Instead of appending it to a list, I just wrote it to another file in the corrected format. file

Re: [Tutor] Space the final frontier!

2006-04-05 Thread Carlo Capuano
Hi! > I am having difficulty removing white spaces from my file. The file is > 999 line = line.replace(' ','') should do the work Carlo. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Space the final frontier!

2006-04-04 Thread Ryan Ginstrom
[Sorry for the initial misfire, John] > [mailto:[EMAIL PROTECTED] On Behalf Of John Corry > 001,newfield,dial=02890790154,dial= > 002,borfiled,dial=02890618521,dial= > 003,newcomp,dial=02890419689,dial= Hi John: I believe the common idiom in this case is ''.join( theString.split( ' ' ) ) >>> th

Re: [Tutor] Space the final frontier!

2006-04-04 Thread Matthew White
Hi John, It would be easier to do all of your whitespace elimination before you append the string to your list(s). Something like this I should get you started: for line in input.readlines(): line = re.sub('[\s]+', '', line) listy.append(line) print listy bonus points for appe

[Tutor] Space the final frontier!

2006-04-04 Thread John Corry
Dear All, I am having difficulty removing white spaces from my file. The file is 999 lines long and looks like the sample below: 001, new field,dial= 028 90 79 0154, dial= 002, borfiled, dial= 02890 618521, dial= 003, newcomp, dial=02890419689, dial= The program, I am using to import the file d