View Single Post
Old 06-11-2016, 10:41 AM   #49
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
@mariaclaudia:

If you copy and paste the following code into the DB Browser for SQLite "Execute SQL" Tab as shown in the attached image, and then run it via the >>> button, it will fix some or all of your corrupt authors. After running it, you must click the "write changes" button at the top.

Obviously, you should not be running Calibre when you do this.

If you have an author with 2 entries in the authors table, 1 correct and 1 corrupt, this will not be able to change the corrupt entry because there is already a correct entry. In that case, you must manually change the bad author as described in previous posts.


Code:
UPDATE OR IGNORE authors 
SET name =  REPLACE(name,',','|') 
WHERE name = sort
   AND name NOT LIKE '%| %'
   AND name LIKE '%, %'
   AND name NOT LIKE '%, Jr%' 
   AND name NOT LIKE '%, Sr%' 
   AND name NOT LIKE '%, PhD%' 
   AND name NOT LIKE '%, Ph.D%' 
   AND name NOT LIKE '%, MD%' 
   AND name NOT LIKE '%, M.D.%' 
   AND name NOT LIKE '%, Junior%' 
   AND name NOT LIKE '%, Senior%'
Please try this in your "new" library first. If it works for you, it will be safe to do in your "real" library.


DaltonST
Attached Thumbnails
Click image for larger version

Name:	abch_sql.jpg
Views:	569
Size:	225.0 KB
ID:	149340  

Last edited by DaltonST; 06-11-2016 at 10:56 AM. Reason: Added info.
DaltonST is offline   Reply With Quote