I'm not sure which formats for columns Recode Columns requires. You can see that we are using different syntaxes for ColNames (I'm using list of column names, and you are using old way to reference columns (Name("col name"), it has been replaced by "col name"n), also we are using different columns in Target Column.
If run the example I gave with this data table:
I end up with this
Here is updated example with new table and more columns added to ColNames list
Names Default To Here(1);
dt = New Table("Untitled 2",
Add Rows(3),
Compress File When Saved(1),
New Column("col 1", Character, "Nominal", Set Values({"1000", "too much", "too much"})),
New Column("col 2",
Character,
"Nominal",
Set Values({"too much", "", ""}),
Set Display Width(65)
),
New Column("col 3", Character, "Nominal", Set Values({"c", "", "too much"})),
New Column("col 4", Character, "Nominal", Set Values({"d", "", ""}))
);
wait(1);
//Create list of columns to be recoded
ColNames = {"col 1", "col 2", "col 3", "col 4"};
For Each({listitem}, ColNames,
dt << Recode Column(
//As Column(dt, listitem),
As Column(listitem),
{Lowercase(_rcNow), If(Contains(_rcNow, "too much"),
"1000",
_rcNow
), Regex(_rcNow, "\D*(\d+\.?\d*)\D*", "\1", GLOBALREPLACE)},
Update Properties(1),
Target Column(Column(listitem))
)
);
-Jarmo