Hallo
Es sollte einfach sein, aber ich kann es alleine nicht herausfinden.
Ich habe zwei Listen und möchte die erste basierend auf der zweiten filtern
- ColList -> enthält meine Tabellenspaltennamen
- CompList -> enthält Extraktionsmittel
Zum Beispiel
ColList = ("aa_Lio", "aa_Leo", "ab_Lio", "ab_Leo", "ac_Lio", "ac_Leo", "ad_Lio", "ad_Leo" )
CompList = ("Lio")
Ziel
Erstellen Sie eine Liste, die ich extractCol nenne, was in meinem Beispiel extractCol = ("aa_Lio", "ab_Lio", "ac_Lio", "ad_Lio") wäre.
Hier ist mein Skript. Wenn ich die For-Schleife nicht verwende, funktioniert es ...
For( k = 1, k <= 1, k++,
For( i = 1, i <= 3, i++,
If( Enthält( ColList[i], CompList[k]) >=1 ,
Einfügen in( extractCol, ColList[i] )
)
);
);
Beste grüße
Lionel
NamesDefaultToHere(1);
ColList = {"aa_Lio", "aa_Leo", "ab_Lio", "ab_Leo", "ac_Lio", "ac_Leo", "ad_Lio", "ad_Leo" };
CompList = {"Lio"};
extractCol = {};
for(k=1, k<=NItems(CompList), k++,
for(i=1, i<=NItems(ColList), i++,
if(EndsWith(ColList[i], CompList[k]), InsertInto(extractCol, colList[i]));
);
);
extractCol;