Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-21-2012, 03:23 PM   #1
da_jane
Evangelist
da_jane will become famous soon enoughda_jane will become famous soon enoughda_jane will become famous soon enoughda_jane will become famous soon enoughda_jane will become famous soon enoughda_jane will become famous soon enough
 
Posts: 405
Karma: 692
Join Date: Sep 2006
Device: Samsung Galaxy Note 3 | Kindle Paperwhite | iPad Mini
Nesting Function arguments in custom columns

I am trying to create a custom column that requires a lowercase Authors and lowercase Title with all the punctuation stripped out. So far I have this:

http://releases.dearauthor.com/wp-content/coverimages/{author:lowercase()}/{title:lowercase()}({id})/cover.jpg

I know I can use re to strip out the punctation such as re(,\,) but I'm not sure where I put that to affect "author".

Do I make two additional custom columns. One to make the author lowercase and then another to strip out the punctuation using re.

lowercaseauthor:re(\,,)

did not work as an argument.

I did figure out a solution. There are probably more elegant solutions. I created four columns. The first two to get the author and title to lower case and then the next two to strip out punctuation and spaces.

{#lowercaseauthor:re([?!. ],)}

{#lowercasetitle:re([?!. ],)}

Last edited by da_jane; 11-21-2012 at 03:47 PM. Reason: Figured out a solution
da_jane is offline   Reply With Quote
Old 11-21-2012, 03:48 PM   #2
chaley
"chaley", not "charley"
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: 5,927
Karma: 1673776
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by da_jane View Post
I am trying to create a custom column that requires a lowercase Authors and lowercase Title with all the punctuation stripped out. So far I have this:

http://releases.dearauthor.com/wp-content/coverimages/{author:lowercase()}/{title:lowercase()}({id})/cover.jpg

I know I can use re to strip out the punctation such as re(,\,) but I'm not sure where I put that to affect "author".

Do I make two additional custom columns. One to make the author lowercase and then another to strip out the punctuation using re.

lowercaseauthor:re(\,,)

did not work as an argument.
You can nest functions in either of template program mode or general program mode. For example, to strip commas from a lowercase author in template program mode you could use
Code:
{authors:'re(lowercase($), ',', '')'}
chaley is offline   Reply With Quote
 
Advertisement
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Agency (ebook) pricing gone from arguments on MR to arguments in court. RichL News 3 12-07-2011 08:40 AM
Custom columns question Noughty Library Management 9 10-11-2011 09:46 AM
Default value for custom columns? rogue_librarian Library Management 5 08-08-2011 06:43 PM
Custom Columns - How are you using yours? nynaevelan Library Management 19 04-18-2011 01:42 AM
0.7.46 and custom columns meme Library Management 4 02-21-2011 05:21 AM


All times are GMT -4. The time now is 11:13 AM.


MobileRead.com is a privately owned, operated and funded community.