Re: [Tutor] Finding duplicates entry in file

2010-03-21 Thread mhw
no Cc: Subject: Re: [Tutor] Finding duplicates entry in file ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ___ Tutor mai

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
On Sat, Mar 20, 2010 at 10:20 PM, Steven D'Aprano wrote: > On Sun, 21 Mar 2010 09:10:52 am Luke Paireepinart wrote: > > On Sat, Mar 20, 2010 at 4:50 PM, Ken G. > wrote: > > > Thanks for the info. I already adopted a program from another > > > person and it works like a charm. As for your ques

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Steven D'Aprano
On Sun, 21 Mar 2010 09:10:52 am Luke Paireepinart wrote: > On Sat, Mar 20, 2010 at 4:50 PM, Ken G. wrote: > > Thanks for the info. I already adopted a program from another > > person and it works like a charm. As for your question, I had no > > idea of if I had duplicate or more as there was

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
Thanks for letting me know. Corrective actions taken. Ken Luke Paireepinart wrote: On Sat, Mar 20, 2010 at 4:50 PM, Ken G. > wrote: Thanks for the info. I already adopted a program from another person and it works like a charm. As for your question

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
On Sat, Mar 20, 2010 at 4:50 PM, Ken G. wrote: > Thanks for the info. I already adopted a program from another person and > it works like a charm. As for your question, I had no idea of if I had > duplicate or more as there was some 570 line items. I whittled it down to > 370 line entries.

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
Thanks for the info. I already adopted a program from another person and it works like a charm. As for your question, I had no idea of if I had duplicate or more as there was some 570 line items. I whittled it down to 370 line entries. Whew. Ken Luke Paireepinart wrote: On Sat, Mar 20

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
On Sat, Mar 20, 2010 at 11:34 AM, Ken G. wrote: > What is a method I can use to find duplicated entry within a sorted numeric > file? > I was trying to read a file reading two lines at once but apparently, I can > only read one line at a time. Can the same file be opened and read two > times wit

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
Thanks! You gave me something to do for the rest of the afternoon. Ken Steven D'Aprano wrote: On Sun, 21 Mar 2010 03:34:01 am Ken G. wrote: What is a method I can use to find duplicated entry within a sorted numeric file? I was trying to read a file reading two lines at once but apparentl

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Steven D'Aprano
On Sun, 21 Mar 2010 03:34:01 am Ken G. wrote: > What is a method I can use to find duplicated entry within a sorted > numeric file? > > I was trying to read a file reading two lines at once but apparently, > I can only read one line at a time. f = open("myfile") while True: first = f.readline(

[Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
What is a method I can use to find duplicated entry within a sorted numeric file? I was trying to read a file reading two lines at once but apparently, I can only read one line at a time. Can the same file be opened and read two times within a program? For example, a file has: 1 2 2 3 4 4