検索して置き換えるスクリプトピーク面積カウントが飽和したときに「飽和(####)」を追加するGCMSプログラムを使用します。これらの結果をExcelからJMPデータテーブルにエクスポートした後、これらのオカレンスを見つけて「saturated()」を削除し、数値を連続した12.0の数値のままにするスクリプトを実行したいと思います。
スクリプティングRe:検索して置き換えるスクリプトインタラクティブに、検索機能を使用して「(」および「)」のグローバル置換を行うのは非常に簡単です。次に、[属性の標準化]を使用して、問題のすべての列を選択し、それらを数値の連続形式に変更できます(12月12日修正)
検索はで利用可能です
編集=>検索=>検索
データテーブルの場合、属性の標準化は左側の列パネルの赤い三角形の下で利用できます。
これもトリックを実行する小さなスクリプトですが、データテーブルが大きいと、遅くなる可能性があります
Names Default To Here( 1 );
dt = Current Data Table();
// Get all character columns
colList = dt << get column names( character, string );
// Loop across all character columns and find those who have the pattern (###)
// and if found, then convert all columns
For( I = 3, i <= N Items( colList ), i++,
If( Left( char(Column( dt, colList[i] )[1]), 1 ) == "(" & Right( char(Column( dt, colList[i] )[1]), 1 ) == ")",
For( k = 1, k <= N Rows( dt ), k++,
If( Left( (Column( dt, colLIst[i] )[k]), 1 ) == "(",
Column( dt, colList[i] )[k] = Substr( Column( dt, colList[i] )[k] ,
2)
);
If( Right( (Column( dt, colList[i] )[k]), 1 ) == ")",
Column( dt, colList[i] )[k] = Word( 1, Column( dt, colList[i] )[k], ")" )
);
);
// Convert to numeric, etc.
Column( dt, colList[i] ) << data type( numeric ) << modeling type( continuous ) <<
Format( "Fixed Dec", 12, 0 );
)
);Re:検索して置き換えるスクリプトスクリプトをありがとうございますが、私は十分に具体的ではなかったようです。スクリプトを書くことは私にとって非常に新しいことであり、数の長さは問題ではないと思いました。それは間違っていたと思います。スクリプトをいじってみましたが、「saturated(635403558)」を635403558に変換できませんでした。私はあなたの助けに感謝します。
Re:検索して置き換えるスクリプトスクリプトは、「(」が最初の文字であり、「)」が最後の文字であることを想定しています。空白文字が最初または最後にある可能性はありますか?
このバージョンのスクリプトを試して、役立つかどうかを確認してください
Names Default To Here( 1 );
dt = Current Data Table();
// Get all character columns
colList = dt << get column names( character, string );
// Loop across all character columns and find those who have the pattern (###)
// and if found, then convert all columns
For( I = 1, i <= N Items( colList ), i++,
If( Left( Trim( Char( Column( dt, colList[i] )[1] ) ), 1 ) == "(" & Right( Trim( Char( Column( dt, colList[i] )[1] ) ), 1 ) == ")",
For( k = 1, k <= N Rows( dt ), k++,
If( Left( (Trim( Column( dt, colLIst[i] ) )[k]), 1 ) == "(",
Column( dt, colList[i] )[k] = Substr( Trim( Column( dt, colList[i] )[k] ), 2 )
);
If( Right( Trim( Column( dt, colList[i] )[k] ), 1 ) == ")",
Column( dt, colList[i] )[k] = Word( 1, Column( dt, colList[i] )[k], ")" )
);
);
// Convert to numeric, etc.
Column( dt, colList[i] ) << data type( numeric ) << modeling type( continuous ) << Format( "Fixed Dec", 12, 0 );
)
);Re:検索して置き換えるスクリプト私が正しく理解していれば、これは使用するチャンスかもしれませんJMPのパターンマッチング(ありがとう@Craige_Hales
:(:(
NamesDefaultToHere(1);
// Define a function
removeSaturated =
Function({inStr}, {Default Local},
// A pattern that will match a span of digits, with or without a leading '-'
digits = (""|"-") + patSpan("0123456789");
// Put the match into 'found' (might be identical to 'inStr')
patMatch(inStr, digits >? found);
// Return 'found' as a number
Num(found);
);
// Try it out
Print(removeSaturated("saturated( 635403558 )"));
Print(removeSaturated("saturated(635403558)"));
Print(removeSaturated("635403558"));
Print(removeSaturated("635403"));
Print(removeSaturated("-635403"));
Print(removeSaturated("saturated( -635403 )"));
Re:検索して置き換えるスクリプト残念ながら、スクリプトを実行しても何も起こりませんでした。データのスクリーンショットと列の属性を含めました。再度、感謝します!

Re:見つけて置き換えるスクリプトエリア列でこれを試してください
Names Default To Here( 1 );
dt = Current Data Table();
// Loop across all character columns and find those who have the pattern (###)
// and if found, then convert all columns
For( k = 1, k <= N Rows( dt ), k++,
If( Contains( :Area[k], "(" ),
:Area[k] = Word( 2, :Area[k], "()" )
)
);
:Area << data type( numeric ) << modeling type( continuous ) << Format( "Fixed Dec", 12, 0 );