Arrange files according to a text file
Ric at rdo
Ric at rdo
Sun Aug 28 01:24:48 EDT 2011
No, it turned out to be my mistake. Your code was correct and I
appreciate it very much.
Thank you again
On Sat, 27 Aug 2011 18:10:07 -0700, Emile van Sebille <emile at fenx.com>
>On 8/27/2011 4:18 PM Ric at rdo.python.org said...
>> Thank you so much. The code worked perfectly.
>> This is what I tried using Emile code. The only time when it picked
>> wrong name from the list was when the file was named like this.
>> Data Mark Stone.doc
>> How can I fix this? Hope I am not asking too much?
>What name did it pick? I imagine if you're picking a name from a list
>of 25000 names that some subset of combinations may yield like ratios.
>But, if you double up on the file name side you may get closer:
>for filename in filenames:
> ratios = [SM(ignore,filename+filename,username).ratio() for
>username in usernames]
> best = max(ratios)
> owner = usernames[ratios.index(best)]
> print filename,":",owner
>... on the other hand, if you've only got a 100 files to sort out, you
>should already be done.
More information about the Python-list