취소
다음에 대한 결과 표시 
표시  만  | 다음에 대한 검색 
다음을 의미합니까? 

Discussions

Solve problems, and share tips and tricks with other JMP users.
언어 선택 변환 막대 숨기기
mostarr
Level IV

Finding the Location of a Column Name Amongst a List of All the Column Names in a Data File

As the post subject implies, I'm trying to find the loc # of a col identified by name in a given data file. I have the column name. Here is my code:

 

column_names = datatable << Get Column Names();
Write(column_names); column_position = loc(column_names, "ARBITRARY COLUMN TITLE/NAME"); Write(column_position);

Write(column_names) works but Write(column_position) outputs an empty matrix []. I don't know why this doesn't work. Any thoughts? I copy pasted the title of the column name, replaced for confidentiality but here denoted by "ARBITRARY COLUMN TITLE/NAME", so it should match exactly.

 

Mike

2 응답 2
mostarr
Level IV

Re: Finding the Location of a Column Name Amongst a List of All the Column Names in a Data File

I did look up the info at <https://www.jmp.com/support/help/en/16.0/index.shtml#page/jmp/get-column-names.shtml> but it didn't help with the bug.
jthi
Super User

Re: Finding the Location of a Column Name Amongst a List of All the Column Names in a Data File

You might have to add String to << get column names also try using Contains() instead of Loc().

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
colNames = dt << Get Column Names(String);
Close(dt, no save);
Contains(colNames, "height");
-Jarmo

추천 글