View Single Post
Old 04-19-2011, 06:25 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by meme View Post
Ok, I've currently implemented this so that if you import collections and the collection name has a "," in it (after the first occurrence of a-zA-Z), I convert the "," to a "\" before loading it into the custom column.
What happens if I am using non-ascii characters? For example, what happens if the collection name is "й,зиц"? Or if the name is "1001,dalmations"? There are no a-zA-Z characters in the first string, and there are none before the comma in the second string.

I think that you want to do 'foo.strip(',').strip()' before processing an item. That will remove any leading or trailing whitespace, then remove any leading or trailing commas.
chaley is offline   Reply With Quote