BookmarkSubscribeRSS Feed
tylerram123

Occasional Contributor

Joined:

Dec 4, 2018

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
uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

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