Scripting > List > Remove Missing ValuesHi JMP Team,
I'm looking for a method to remove missing / empty values from a List generated within a script:
The initial List looks like: {.,.,.,2,3,4,7,.,.,.} and I would like to end up with a new List = {2,3,4,7}.
Any ideas how to achieve that without relying on a a loop through the List elements?
Thanks.
Best,
TS
Automation and ScriptingData Blending and CleanupQuality and Process EngineeringRe: Scripting > List > Remove Missing ValuesIn case you already haven't figured it out. it does work but it only returns a copy. if you want to alter x you'd have to either reassign it or use removefrom()
Names default to here(1);
x = {.,.,.,2,3,4,7,.,.,.};
new_x = remove(x, as list(loc(x, .)));
show(x, new_x);
removefrom(x, as list(loc(x, .)));
show(x, new_x);Re: Scripting > List > Remove Missing ValuesCan you supply a code snippet and the error message?
If your list contains character strings then loc will not work - it's only for numbers.
Here's a solution for a list of strings with empty values.
a = {"a", "", "b", "", "c", "d", "e"};
b = concat items(a, ";");
c = words(b, ";");
Challenge: anyone with an alternate solution?
Re: Scripting > List > Remove Missing ValuesHi Ryan,
I don't know why but your script does not work for me... (I have JMP 16, in case it can help to debug the issue)
Re: Scripting > List > Remove Missing ValuesAlso,
Names Default to Here( 1 );
original = [.,.,.,2,3,4,7,.,.,.];
none missing = original[Loc( Not( Is Missing( original ) ) )];
Re: Scripting > List > Remove Missing ValuesHi Ian,
Nice touch with adding "42" to the list: let's stay clear of the Vogon 
Best,
TSRe: Scripting > List > Remove Missing ValuesAlternatively:
NamesDefaultToHere(1);
in = {.,.,.,2,3,4,7,.,42,.};
out = in[LocNonMissing(in)];
Print(out);Re: Scripting > List > Remove Missing ValuesHi @Thierry_S ,
Try this,
x = {.,.,.,2,3,4,7,.,.,.};
remove(x, as list(loc(x, .)));