
ファイル名の内容に基づいて列プロパティに単位を追加するにはどうすればよいでしょうか。この場合、末尾に_電圧がある場合は単位としてVを使用します。末尾に_Current がある場合は単位としてA を追加します。
以下に簡単な例を示します。
Names Default To Here( 1 );
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
colNames = dt << get column names( continuous, string );
For Each( {col}, colNames,
If(
Contains( col, "hei" ),
Column( col ) << set property( units, "inches" ),
Contains( col, "wei" ),
Column( col ) << set property( units, "lbs" )
)
)
;
