Orders of magnitude

Stefan Axelsson crap1234 at hotmail.com
Tue Mar 30 06:52:06 EST 2004


Buck Nuggets wrote:

> step 1: sort the file using a separate sort utility (unix sort, cygwin
> sort, etc)
> 
> step 2: have a python program read in rows, 
>         compare each row to the prior,
>         write out only one row for each set

It might be worth mentioning that if your idea of 'sameness' is 
identical textual representation, the '-u' flag of 'sort' does step 2 
for you. Won't work in the more general case, but then 'sort' might not 
work either. YMMV.

Stefan,
-- 
Stefan Axelsson  (email at http://www.cs.chalmers.se/~sax)



More information about the Python-list mailing list