Quote:
Originally Posted by ownedbycats
Related to this: I am trying to remove "Crossover" from fanfics that technically aren't crossovers:
Code:
program:
f = $#fanficcat;
if
contains(
f, '^Crossover, Mass Effect Trilogy, Mass Effect: Andromeda$', '1', ''
)
then
'Mass Effect Trilogy, Mass Effect: Andromeda'
elif
contains(
f, '^Crossover, Half-Life, Portal$', '1', ''
)
then 'Half-Life, Portal'
else
$#fanficcat;
fi
However, this fails on two fronts:
1. In template tester, it only works if the tags are in that exact order. Since it appears sorted in book details it's hard to tell.
2. Putting this in Action Chains' single-field edit on a book that tested fine just results in the column becoming empty.
Any idea how to do this?
|
The function list_difference() removes items, but it isn't clear what you want to do. Are you asking to remove 'Crossover' if #fanficcat contains some other items, and possibly only those items? What exactly are the rules?
EDIT: writing down the rules can help with formulating the correct expressions. If you run into situations where the answer is "It depends" then you aren't done.