For example, I have a table:

1. All column names contain "CHA/", how could I remove it quickly and leave it like "Temp""Pressure" and "Flow"? In the real case, I have hundreds of columns containing "CHA/".
2. How could I make the first row as the column names?
3. Is there any way to remove "CHA/" from all the cells in the table?
Thank you!
1. You can use Recode Column Names to clean those


2. Top row to column names

3. Yes, either by scripting or using Search dialog and replace all


- @jthi provided a great interactive solution however, you may want to consider using a simple script that will change the column names that begin with CHA/
Names Default To Here( 1 );
dt = Current Data Table();
nameList = dt << get column names( string );
<BR />
For Each( {col}, nameList,
If(
Starts With(
col,
"CHA/",
Column( dt, col ) << set name( Substr( col, 5 ) )
)
)
);
2.
1. If your data is input from a csv or txt file, you can use the input wizard to specify to use row 1 as the column headers.
2. Or you can use a simple script to do the work.
Names Default To Here( 1 );
dt = Current Data Table();
nameList = dt << get column names( string );
For Each( {col}, nameList,
column( dt, col) << set name( col[1] )
);
dt << delete rows(1);
3. The search the columns for the value "CHA"
1. If the values are in what needs to be a numeric column, just by changing he column to be numeric will delete CHA from the cells in the column.
2. Or this simple script should do it
Names Default To Here( 1 );
dt = Current Data Table();
nameList = dt << get column names( string );
For Each( {col}, nameList,
Try( Column( dt, col )[dt << get rows where( col == "CHA" )] = "" )
);Thank you! It worked and its very helpful!
Thank you!
I will try the script you show which is more flexible with more customized requirements.