We’re asking you to select a content label when starting a new topic in the Discussions area. Read more to find out why.
Choose Language Hide Translation Bar
Highlighted
tylerram123
Level III

How to sort through multiple columns by characters in the column name

I am guessing something like:

 

For( i = 2, i <= N Cols( dt ), i++,
Column( dt, i ) << set name(
Word( 1, Column( dt, i ) << get name, " " ) || " " || Column( dt, i )[1]
)
); 
dt << delete rows( 1 );
For( i = 2, i <= N Cols( dt ), i++,
Column( dt, i ) << data type( numeric ) << modeling type( continuous )
);
 
// Change the name of the first column to H(Oe)
Column( dt, 1 ) << set name( "H(Oe)" );
// Create a list of all numeric column names
colNamesList = dt << get column names( numeric );
 
for (i=0, i =< N cols, i++
if ( colname == 'Ic"),
sort( by col()),
bivariate(
//Create Parameters
xParam = Column(dt, "Ic"), zParam = Column(dt, "H (Oe)"),
Y( Eval(xParam) ),
X( Eval(zParam) ),
Fit Line( 1 )
);
);
 

 

 

1 REPLY 1
Highlighted
uday_guntupalli
Level VIII

Re: How to sort through multiple columns by characters in the column name

@tylerram123

 

 

dt = Current Data Table(); 

ColNames = dt << Get Column Names("String"); 

SortedColNames = Sort List(ColNames); 

Print(ColNames); 

Print(SortedColNames); 
Best
Uday