View Single Post
Old 11-03-2019, 05:17 PM   #1
lduchastel
Junior Member
lduchastel began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2017
Device: Kindle Paperwhite
Help for complex Save to disk template

Hello,

I am not a programmer and I does not understand much regex but can manage some basic template functions.

I read dozens of posts about Save to disk issues and needs, and grabbed pieces of code here and there, but I am limited by my own incomprehension of programming language and complexity of my needs to make sense of all of them:

This what I would like to perform:

Code:
If custom field {#propername} exists, use that field only

   otherwise output filename as follow:

Authors (assuming all records are already Ln, Fn)
- Have last names in capitals
  {authors:'list_re_group($, ' & ', '.', '(.*?)(,|$)(.*)', '[[$:uppercase()]]')'}
- Use not more than two authors if more:
  {author:sublist(0,2,&)}
- Max length being 20 left characters
  {author:.20}

Year in parenthesis (assuming %Y in Format date as:)
  {pubdate:| (|) }

Series name
- Display if exists
- Max length being 20 left characters
  {series:.20| |}

Series index
- Display if exists
- with leading 0 and brackets
  {series_index:0>2s| [|] }

Title
- Colon character : in tile being replaced by --
  {title:re(:,--)}
- Max length being 70 left characters
- {title:.70}

Tweaks applied:
author_sort_copy_method = u'copy'
gui_pubdate_display_format = u'yyyy'
save_template_title_series_sorting = u'strictly_alphabetic'
For instance,

GALLO, Max & HART, John (2004) MBA Essentials [01] Accounting

I can make only some of the functions to work at the same time, but cannot make them to work all at the same time.

Is a single template disk line can do that ?
Otherwise, what I should do ?

Thanks for any advice.

Thank you
lduchastel is offline   Reply With Quote