![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Feb 2020
Device: none
|
![]()
I'm experimenting with custom columns, and I'd like to add one with the file path in it. The problem is that the formats_paths function gives me a list which is far too long.
First I get the formats information (which I don't need) and then I get the full path of each version of the file - when actually what I'm looking for is the element of the path that is unique to each book (i.e. the file path for a the folder the files are in, without the preceding information about where the library is) For example, at the moment I would get something like: "EPUB: C:\calibre library location which is a very long string\then the specific library that calibre is looking at\and finally the interesting bit\title.epub,ORIGINAL_EPUB: C:\calibre library location which is a very long string\then the specific library that calibre is looking at\and finally the interesting bit\title.original_epub" etc. etc What I'd like to do is get something like: "...\and finally the interesting bit\" Sorry if this is difficult to follow, can anybody help me? I'm sure I'm not the only one who's wanted to do this... Thanks! ![]() |
![]() |
![]() |
![]() |
#2 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,611
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
The "...\and finally the interesting bit\" would seem to be the directory name that is derived (ascii-ized and sanitized) from the first author name. I'm curious, no puzzled, why anyone would want such a thing - if they're interested they can just press O' and look at the top of the File Explorer window. BR Last edited by BetterRed; 02-28-2020 at 10:49 PM. |
|
![]() |
![]() |
![]() |
#3 |
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
|
Firstly, the formats_paths function returns exactly what it is supposed to. It returns a list of the full paths for each format for the book with the format as a prefix. When using the Template editor, you can see the definition of each function by selecting the function lower half of the editor.
As to your template, I think you are after the name of the directory that holds the book. The following will do this: Code:
{:'re(formats_paths(),".*\\([^\\]*?)\\[^\\]*?$","\1")'} If you need to do this on a non-Windows box, the path separator will need to be changed. |
![]() |
![]() |
![]() |
Tags |
column settings, cutstomizing, path |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Column to show file date | Bigo2 | Library Management | 2 | 12-28-2016 03:12 AM |
Plugin or custom column to show GB size of book | mom34spartan | Plugins | 5 | 07-08-2013 09:07 AM |
custom column: count number of characters (in book path) | miquele | Library Management | 25 | 09-21-2012 01:54 PM |
Custom column showing path length? | xterminal | Library Management | 1 | 09-11-2012 09:12 AM |
Kindle: Show ebook reading status in custom column | AndyW1691 | Library Management | 0 | 01-22-2012 04:40 PM |