列名に基づいて複数の列を削除するやあ 、
列名に含まれる特定の文字列に基づいて、複数の列を削除したいと思います。 私は単一の名前でそれを行うことができます。 ただし、複数の名前の場合は機能しません。
col_list = dt << get column names(string);
for(i = nitems(col_list)、i> 0、i--、
if(contains(col_list [i]、 "SAVED_IMAGES"、 "sw_"、 "HH")、
from(col_list、i);を削除します。
);
);
このエラーを表示します
dt =現在のデータテーブル();
col_list = dt << get column names(string);
For(i = N Items(col_list)、i> 0、i--、
If(Contains(col_list [i]、 "SAVED_IMAGES"、 "SS_EID")、
From(col_list、i)を削除します
)。
);
スクリプティングRe:列名に基づいて複数の列を削除するこれが私がそれをする方法です
col_list = dt << get column names( string );
For( i = N Items( col_list ), i > 0, i--,
If(
Not(
Contains( col_list[i], "SAVED_IMAGES" ) | Contains( col_list[i], "sw_" ) |
Contains( col_list[i], "HH" )
),
Remove From( col_list, i )
)
);
Re:列名に基づいて複数の列を削除するこのスクリプトは、列にそれらの名前を含む列を削除します。 そのままにしておきたい場合はどうすればいいですか
それらの特定の列(それらの名前を含む)と他の列を削除しますか?
Re:列名に基づいて複数の列を削除する私があなたの質問を理解した場合、あなたは列名と文字列の両方を繰り返して一致させたいと思います:
col_list = dt << get column names(string);
remove_strings = {"SAVED_IMAGES", "sw_", "HH"};
//for each column name
for (i = nitems(col_list), i > 0, i--,
//for each string to match
for( j = 1, j <= N Items( remove_strings ), j++,
//if it matches remove the item
if( contains( col_list[i], remove_strings[j] ) > 0,
remove from(col_list, i);
);
);
);Re:列名に基づいて複数の列を削除する比較に使用する必要のある構造は次のとおりです。
if (contains(col_list[i], "SAVED_IMAGES") & contains(col_list[i], "sw_") &
contains(col_list[i], "HH"),