Quote:
Originally Posted by chaley
Yes, but the syntax is different from what you wrote. Here is your template, corrected.
|
This is not me trying to be a being a wise ass but I've tested this but it's not quite working the way I wanted.
Let say that my custom_column named #ao3show contains the following items:
Code:
Bus, Car, Ferry, Ferry Terminal, Red
I've then entered your code as follows:
Code:
program:
sample_input = 'Bus, Car, Ferry, Ferry Terminal';
list = 'bus, ferry';
output = '';
# Change $#custom_column to sample_input so the value exists, avoiding an error.
for item in sample_input:
if ('^' & item & '$') inlist list then ni = 'Public Transport'
else ni = item
fi;
output = output & ',' & ni
rof;
output = list_sort(list_remove_duplicates(output, ','), 0, ',')
The outcome is:
Code:
Car, Ferry Terminal, Public Transport
Red is gone completely, not replaced just gone.
Whereas if I replace the list sample_input with the actual column and add a 2nd list with tags I want to remove like this:
Code:
program:
list = 'bus, ferry';
list2 = 'Car';
output = '';
# Change $#custom_column to sample_input so the value exists, avoiding an error.
for item in $#ao3show:
if ('^' & item & '$') inlist list then ni = 'Public Transport'
elif ('^' & item & '$') inlist list2 then ni = ' '
else ni = item
fi;
output = output & ',' & ni
rof;
output = list_sort(list_remove_duplicates(output, ','), 0, ',')
The outcome is:
Code:
Ferry Terminal, Public Transport, Red
I would then use the other piece of code you helped me with to transfer "Public Transport" from #ao3show to #show, the latter only containing tags I want to keep which would leave me with the tags not mentioned in 'list' or 'list2'. This would allow me to run the action after downloading and then check the remaining tags to see whether or not I find them useful.