Re: Compare list entry from csv files

2012-11-30 Thread Anatoli Hristov
> As I said before, process both files into lists, one that you treat as > constant (and therefore capitalized) and the other containing the data > you intend to modify. > > It'd be much cleaner if you did all that input file parsing stuff in one > function, returning only the lists. Call it just

Re: Compare list entry from csv files

2012-11-30 Thread Anatoli Hristov
> Can you print ex_phone first. You are opening the files in text mode > so I wonder if the line endings are causing you to read and extra > "line" in between. Can you try reading the csv as "rb" instead of > "rt"? Yes I did this: use the global list PHONELIST and opening the CSV in binary - it wo

Re: Compare list entry from csv files

2012-11-29 Thread Dave Angel
On 11/29/2012 05:22 AM, Anatoli Hristov wrote: > > Hello, > > Tried to document a little bit the script, but I'm not that good in that too > :) > > The only problem I have is that I cant compare other field than the > first one in > for ex_phone in phones: > telstr = ex_phone[0].lower() >

RE: Compare list entry from csv files

2012-11-29 Thread Prasad, Ramit
Anatoli Hristov wrote: > Hello, > > Tried to document a little bit the script, but I'm not that good in that too > :) > > The only problem I have is that I cant compare other field than the > first one in > for ex_phone in phones: > telstr = ex_phone[0].lower() > When I use telstr = ex_p

Re: Compare list entry from csv files

2012-11-29 Thread Thomas Bach
Can you please cut the message you are responding to the relevant parts? On Thu, Nov 29, 2012 at 11:22:28AM +0100, Anatoli Hristov wrote: > The only problem I have is that I cant compare other field than the > first one in > for ex_phone in phones: > telstr = ex_phone[0].lower() > When I u

Re: Compare list entry from csv files

2012-11-29 Thread Anatoli Hristov
On Tue, Nov 27, 2012 at 9:41 PM, Neil Cerutti wrote: > On 2012-11-27, Anatoli Hristov wrote: >> Thank you all for the help, but I figured that out and the >> program now works perfect. I would appreciate if you have some >> notes about my script as I'm noob :) Here is the code: >> >> import csv >

Re: Compare list entry from csv files

2012-11-27 Thread Neil Cerutti
On 2012-11-27, Anatoli Hristov wrote: > Thank you all for the help, but I figured that out and the > program now works perfect. I would appreciate if you have some > notes about my script as I'm noob :) Here is the code: > > import csv > > origf = open('c:/Working/Test_phonebook.csv', 'rt') > secf

Re: Compare list entry from csv files

2012-11-27 Thread Dave Angel
On 11/27/2012 01:57 PM, Anatoli Hristov wrote: > > > Thank you all for the help, but I figured that out and the program now > works perfect. Wow! > I would appreciate if you have some notes about my > script as I'm noob :) > Here is the code: > > import csv > > origf = open('c:/Working/Test_pho

Re: Compare list entry from csv files

2012-11-27 Thread Anatoli Hristov
On Tue, Nov 27, 2012 at 4:05 PM, Neil Cerutti wrote: > On 2012-11-27, Anatoli Hristov wrote: >> Thanks for your help. I will do my best for the forum :) >> >> I advanced a little bit with the algorithm and at least I can >> now extract and compare the fields :) For my beginner skills I >> think t

Re: Compare list entry from csv files

2012-11-27 Thread Neil Cerutti
On 2012-11-27, Anatoli Hristov wrote: > Thanks for your help. I will do my best for the forum :) > > I advanced a little bit with the algorithm and at least I can > now extract and compare the fields :) For my beginner skills I > think this is too much for me. Now next step is to add the > second

Re: Compare list entry from csv files

2012-11-27 Thread Anatoli Hristov
On Tue, Nov 27, 2012 at 4:23 AM, Dave Angel wrote: > On 11/26/2012 05:27 PM, Anatoli Hristov wrote: >> I understand, but in my case I have for sure the field "Name" in the >> second file that contains at least the first or the last name on it... >> So probably it should be possible:) >> The Name "

Re: Compare list entry from csv files

2012-11-26 Thread Dave Angel
On 11/26/2012 05:27 PM, Anatoli Hristov wrote: > I understand, but in my case I have for sure the field "Name" in the > second file that contains at least the first or the last name on it... > So probably it should be possible:) > The Name "Billgatesmicrosoft" contains the word "Gates" so logically

Re: Compare list entry from csv files

2012-11-26 Thread Emile van Sebille
Anatoli Hristov wrote: I understand, but in my case I have for sure the field "Name" in the second file that contains at least the first or the last name on it... So probably it should be possible:) The Name "Billgatesmicrosoft" contains the word "Gates" so logically I might find a solution for i

Re: Compare list entry from csv files

2012-11-26 Thread Anatoli Hristov
I understand, but in my case I have for sure the field "Name" in the second file that contains at least the first or the last name on it... So probably it should be possible:) The Name "Billgatesmicrosoft" contains the word "Gates" so logically I might find a solution for it. Thanks On Mon, Nov 2

Re: Compare list entry from csv files

2012-11-26 Thread Dave Angel
On 11/26/2012 04:08 PM, Anatoli Hristov wrote: > Hello, > > I'm trying to complete a namebook CSV file with missing phone numbers > which are in another CSV file. > the namebook file is structured: > First name;Lastname; Address; City; Country; Phone number, where the > phone number is missing. > >