Hi!
I want to delimit multiple column using JSL but in vain
I've tried 2 method
1. Use "Contains" to select the specific column but last column always not get selected and delimit
2. Use regular expression but non of the column getting search and selected.
If anyone could help take a look and clear my doubt would be much appreciated. Thanks
attached the jmp table sample
//1st method
dt = Data Table( "project_list" );
columnsToDelimit = {};
allColumns = dt << Get Column Names(String);
For( i=1, i <= N Items (allColumns ), i++,
If( Contains ( allColumns[i], "MODEL"),
Insert into( columnsToDelimit, Column ( allColumns[i])),
);
);
For(i = 1, i < N Items ( columnsToDelimit ), i++,
dt << Text to Columns (
Delimiter("%"),
Columns( columnsToDelimit[i])
);
);
//2nd method
dt = Data Table( "project_list" );
delimit_List = {};
col = dt << Get Column Names( String );
for (i = 1, i <= nitems(col), i++,
if(Regex Match(col[i], "(.*)MODEL(.*)"),
Insert Into( delimit_List, Column( col[i]));
);
);
For(i = 1, i < N Items ( delimit_List ), i++,
dt << Text to Columns (
Delimiter("%"),
Columns( delimit_List[i])
);
);