![]() |
#856 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
thank you for your help
I have the file name and asin. I have no clue how to do result. but i do have one other problem. The file names all have _ebok on the end. This will result in all of the compares resulting in no. Any idea for a work around? |
![]() |
![]() |
![]() |
#857 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
I have been fighting with this all afternoon. I figured out the file name issue but i cant make the custom column work.
Lookup Name: results Column Heading: Results Column Type: Column built from other columns Template: {results: strcmp(#asin, #file, yes, no, na)} But it doesn't work. What am I doing wrong? Please help |
![]() |
![]() |
Advert | |
|
![]() |
#858 | |
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
|
Quote:
Code:
{#asin:strcmp(#file, yes, no, na)} |
|
![]() |
![]() |
![]() |
#859 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
Thank you for your help. The equation works but isn't returning accurate results. Even though the asin and file name match its returning na NA should only come up if one or both fields are empty.
I've attached snapshots Im not sure why this is so difficult |
![]() |
![]() |
![]() |
#860 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,638
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
Advert | |
|
![]() |
#861 | |
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
|
Quote:
Code:
program: strcmp(raw_field('#asin'), raw_field('#file'), 'yes', 'no', 'na'); |
|
![]() |
![]() |
![]() |
#862 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
BetterRed I was still getting na even though they matched
davidfor I tried your suggestion: template: {#asin:strcmp(raw_field('#asin'), raw_field('#file'), 'yes', 'no', 'na')} error: TEMPLATE ERROR: incorrect number of arguments for strcmp |
![]() |
![]() |
![]() |
#863 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,342
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You didn't actually try what he suggested. Try the 2 lines of code *exactly* as he wrote it, including the word "program". Note that there are not any curly braces in his suggestion.
|
![]() |
![]() |
![]() |
#864 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
i didn't know I could put the word program in there. OK done. Now it is returning NO even though they match. Is it possible that this is because I am using the GetFileName plugin to get the file name and extract the extension? So that even though I cant see the file extension in the File column, the system still does?
|
![]() |
![]() |
![]() |
#865 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,342
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#866 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
ok so it is working. What i am looking for is:
return "yes" if #asin = #file return "no" if #asin ≠ #file return "na" if #asin or #file is empty |
![]() |
![]() |
![]() |
#867 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,342
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: asin = raw_field('#enum2'); file = raw_field('#enum2'); first_non_empty ( strcmp(file, 'None', '', 'na', ''), strcmp(asin, 'None', '', 'na', ''), strcmp(file, asin, 'no', 'yes', 'no') ) |
|
![]() |
![]() |
![]() |
#868 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
Chaley I copied and pasted that directly into the template field for the results column and everything came back NA
|
![]() |
![]() |
![]() |
#869 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,342
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#870 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
IT WORKS!!!! Thank you everyone for your help.
|
![]() |
![]() |
![]() |
Tags |
custom column, tag, tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |