データを列に解析し、複数の特殊文字を積み重ねるにはどうすればよいでしょうか生データがあり、多くの特殊文字を含む列にテキストを書き込み、それらを積み重ねる必要があります。一般的なケースの JSL スクリプトによるソリューションを提供してください。詳細については、私の Excel ファイルを参照してください。
自動化とスクリプトRe: データを列に解析し、複数の特殊文字を積み重ねるにはどうすればよいですか?ジムさん、解決策をありがとう。
ティン
Re: データを列に解析し、複数の特殊文字を積み重ねるにはどうすればよいですか?これが私の最初のパスのスクリプトです。このアプローチにより、完全なデータテーブルで何を調整する必要があるかを確認するために必要な情報が得られるはずです。
Names Default To Here( 1 );
dt = Current Data Table();
// Create the new columns
dt << New Column( "domain_frequency_core", character );
dt << New Column( "Data" );
// Create the static part for the column domain_frequency_core
startString = "Data@" || Word( 1, :string_result[1], ":" );
// Read into a memory variable the entire string, minus the startString component
theString = Word( 2, :string_result[1], ":_" );
// Initialize the looping variables
outerLoop = 1;
theRow = 0;
// Loop through the major groupings in the data
While( Word( outerLoop, theString, "%" ) != "",
// Strip off the subpart of the string
majorWord = Word( outerLoop, theString, "%" );
// Get the second component of the start string
startStringSuffix = "@" || word(1,majorWord,"^") || "@";
// Initialize the inner loop value, starting with word 2
innerLoop=2;
// Loop through the subgroup finding each numeric component
While( word(innerLoop, majorWord, "^V") != "",
// Add a new row
if(theRow !=0, dt<<ADD rows=""></ADD>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1712831359209.png" style="width: 668px;"><span class="lia-inline-image-display-wrapper" image-alt="txnelson_0-1712831359209.png" style="width: 668px;"><img src="https://us.v-cdn.net/6038925/uploads/images/63259i1123569D89D26136/txnelson_0-1712831359209.png" width="668" height="330" role="button" title="txnelson_0-1712831359209.png" alt="txnelson_0-1712831359209.png" /></span></SPAN></P>
<P> </P>Re: データを列に解析し、複数の特殊文字を積み重ねるにはどうすればよいですか?こんにちは、ジムさん
私のデータを誤解しているようですが、あなたが書いたコードが出力です。
「生データ」シートの参照にご協力ください

シート「解析後のデータ」に出力が期待されます

よろしくお願いします。
Re: データを列に解析し、複数の特殊文字を積み重ねるにはどうすればよいですか?これは、元のデータ テーブルを取得してターゲット列を分割し、結果を積み重ねるスクリプトです。分割された列の一部は文字列データのみで構成され、一部は数値であるため、すべての列を積み重ねるのはおそらく望ましいことではないようです。
Names Default To Here( 1 );
dt = Current Data Table();
targetCol = "domain_frequency_core";
// Text to columns
Data Table( "Book1 (4)_Sheet1" ) <<
Text to Columns( columns( Column( targetCol ) ), Delimiters( "@" ) );
// Get list of all target columns except original column
stackList = Filter Each( {name}, dt << get column names( string ),
Contains( name, targetCol ) & name != targetCol
);
// Stack the new columns
dt << Stack(
columns( stackList ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Output Table( "Final Stacked Data Table" )
);
時間をかけてスクリプトを学習してください。使用されるすべての関数とプラットフォームは、スクリプト インデックスと JMP ヘルプ画面に記載されています。