Quote:
Originally Posted by kiwidude
In find/replace, is it possible to take the value from the author_sort field and put it into the author field? Presumably her existing author_sort is probably pretty correct already. If she could do that it would save a lot of typing.
|
Possible, but probably not a good idea, because it will produce incorrect results for books with multiple authors. The problem arises because authors is a multiple field, but author_sort is a single field. S/R does the work for each item in a multiple field, so each author would be set to the combined author sort. The result would be a mess.
Better would be to use a regexp on author to flop the names around. One would first select all books with no comma in the authors' names, then apply something like the following:
Code:
Mode: regexp
Source: authors
Search: ^(.*) ([^ ]*)$
Replace: \2, \1
Dest: authors
Ignore the fact that the comma becomes a | in the result. This happens because calibre uses comma to separate authors, so internal commas are changed to bars.