I have several columns of data with numbers in.
When I import the data from excel some columns get imported as strings.
I would like to be able to loop through all columns and change their data type to integer.
The below script is an attempt to change one column.
col_list = dt << Get Column Names ()
dt << Begin Data Update;
dt << Recode Column(
dt;col_list[21],
{Num( _rcNow )},
Update Properties( 1 ),
Target Column( ;col_list[21] )
);
dt << End Data Update;
The command below gives the right column but the code above gives an error on line 5 stating "Source column cannot be found in access or evaluation of 'Glue' , dt; /*###*/col_list[21] /*###*/;" I was wondering if I had to write the code as an expression then evaluate it and substitute the column into the relevant parts.
Show(dt;col_list[2]);