View Single Post
Old 06-24-2014, 10:51 PM   #3
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)
Use this, in general program mode. Or tweak into another mode, but general program mode is awesome for complex stuff, like combining multiple fields in one using complex regexes and function calls.

It will only parse the first author.

Code:
program:

	FN=re(
		field('author_sort'),
		'([^,]+),.+',
		'\1'
	);

	LN=re(
		field('author_sort'),
		'[^,]+,(.+)',
		'\1'
	);

	fixed_author_sort=strcat(
		uppercase(FN),
		LN
	)

Last edited by eschwartz; 06-25-2014 at 03:31 AM.
eschwartz is offline   Reply With Quote