|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 63
Karma: 43710
Join Date: Jun 2008
Device: zaurus->palm->iPad->Sony PRS-T1,T2,T3->KoboForma&Likebook Ares->Palma2
|
Template for folder/filename for Author/Title with Chinese characters
Hi there,
Not sure if this is the right place to post, so please bear with me. I am trying to construct a template that will create a folder hierarchy on the device. I want to have it start with the first character of author_sort, then on the next level author_sort and finally the book title. It looks like this: {author_sort:.1}/{author_sort}/{title} This works very nice for books in English or German, but I also have Chinese and Japanese books in my library. For a Chinese book (Author: 李百药 Title: 二十四史-北齐书), it will come out like this: Li/Li Bai Yao/Er Shi Si Shi -Bei Qi Shu.epub This somehow in the background converts the Chinese characters to an alphabetic representation. This part is fine with me, because I understand it wants to work across platforms. However, this conversion should be applied *before* getting the first character, because the Latin representation of one Chinese character will typically be more than one character. So what I expect it should like like is as follows: L/Li Bai Yao/Er Shi Si Shi -Bei Qi Shu.epub Is there a way to achieve this? Or has this to be fixed in Calibre? All the best, Ctop |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I think the following will work:
Code:
{:'substr(transliterate(field("author_sort")),0,1)'}/{author_sort}/{title} |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 63
Karma: 43710
Join Date: Jun 2008
Device: zaurus->palm->iPad->Sony PRS-T1,T2,T3->KoboForma&Likebook Ares->Palma2
|
Wow, indeed it does work beautifully! Thank you so much!
Ctop |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replacing characters in title & author | April | Calibre | 2 | 06-19-2018 12:19 PM |
Import Author and Title from Filename & Cover from File | Alcohol | Library Management | 3 | 06-25-2017 11:19 AM |
Changing metadata(title and author) in bulk/by macro from filename possible? | thosedays | Reading and Management | 0 | 10-20-2016 08:17 AM |
importing PDF with author, title in filename | autchirion | Library Management | 3 | 02-22-2011 11:46 AM |
Non-English characters in title / author | lejuan | Calibre | 7 | 01-18-2010 03:52 PM |