View Single Post
Old 12-19-2022, 06:02 AM   #4
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: 12,516
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Req13 View Post
Thank you for responding. I plugged this into the template editor in saving books to disk:

Code:
program:
	t = $title;
	t = re(t, '\?', '');
	t = re(t, ':', ';');
# Add any more changes that you want.
This outputs just the title of the book.

I was hoping to have an output of the author and title like this:

Author - Title

I can't figure out how to add the author to your code.

Thanks again.
You don't say whether you want any transforms to the authors names, or if you want all the authors or only the first. I assume no transforms and all the authors.

Use:
Code:
program:
# The authors
	a = $authors;
# Do any transforms you want to authors
# For example, to get the first author
#	a = list_item(a, 0, '&');

# The title
	t = $title;
	t = re(t, '\?', '');
	t = re(t, ':', ';');
# Add any more changes that you want.

# Construct the final output
	a & ' - ' & t
chaley is offline   Reply With Quote