Dynamically loop through columns with Column Expression node?

Hello again,

this might have already been solved but I couldn’t find anything. My goal is to loop through all (30+) columns and replace any occurrence of one or more asterisks with two dashes.

I’m using the Column Expression node, replacing column by column which I think is too complicated as a solution.

What I’m looking for is to loop through all columns dynamically. Unfortunately, the column expression - when chosing “Replace Column” - forces me to select a specific column and not set it to, for example, a variable. If that’s possible, then I haven’t figured it out yet. Help is highly appreciated here.

Here’s the code I’m using in the Column Expression (Replace Column):

// Example for column "CPUSpec3"
if(column("CPUSpec3") == null)
{null}
else
{
regexReplace(column("CPUSpec3"), "\\*+", "*")
regexReplace(column("CPUSpec3"), "\\*+", "*"), "\\*", "--")
}

Currently my table looks something like this:

| CPUSpec1               | CPUSpec2                  | CPUSpec3                       | CPUSpec4             |
| Intel Core i7-12700KF, | 8C+4c/20T, 3.60-5.00GHz,  | ********************           | Boxed                |
| Intel Core i7-14700KF, | 8C+12c/28T, 3.40-5.60GHz, | 5.60GHz (Turbo Boost Max 3.0), | ******************** |
| Intel Core i7-10700K,  | 8C/16T, 3.80-5.10GHz,     | ********************           | Boxed w/o cooler     |
| Intel Core i5-10600KF, | 6C/12T, 4.10-4.80GHz,     | Intel 1200 (LGA1200)           | ******************** |

Maybe the Column Expression node is not what I am looking for here?

Thank you!