View Single Post
Old 06-25-2014, 05:49 AM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Currently you can use my program: block to "fix" the author_sort for your use. I would recommend using it inside {:'program-goes-here'} e.g.

Code:
{:'program:FN=re(field("author_sort"),"([^,]+),.+","\1");LN=re(field("author_sort"),"[^,]+,(.+)",\1");fixed_author_sort=strcat(uppercase(FN),LN)'}
can be used as a template to produce author_sort_fixed.

Either code block works, but:
  • This new one is stuck into a template, allowing you to follow it with more standard templates.
  • The previous one was meant for integrating into program mode, where any further sections have to be called with the field function and strcat'ed onto the last function call. If you don't understand this, you don't have to -- just use the new one.
Using general program mode is only required for people who want to spend time making it look nice. And are probably a little obsessed about it. As you can see, the code I just gave is a long incomprehensible blob without the neatly-laid-out whitespace and stuff. But it works just as well once written.

Also, you can use chaley's new function if you are willing to wait until Friday (and the next calibre release).

Last edited by eschwartz; 06-25-2014 at 06:19 AM. Reason: grammar
eschwartz is offline   Reply With Quote