Apply formulas to all columns
Best Answer
-
My method of doing this was to create a loop inside the Apply Formulas to Table step:
var i = 1
while (i<100) {
columns[i] = columns[i].replace(/"/g,'');
i++; }
I used the above since I just had to replace quotation marks in ALL columns, but ranges can be used if something specific needs to be done over specific columns:
for (i=22;i<51;i++) {
columns[i]= columns[i].replace(/\-/gm, '0')
}
In general I'd use a While loop for formatting EVERYTHING and a For loop for ranges, as shown above.
Both of these should be able to be used in Apply Formulas to Table. Very useful if you don't know the names or order of the columns in your table, and have to format multiple columns. Or just have to format a large number of columns with the same formulas. Just be sure to declare the variablei
before the loop (e.g.var i = 1
).7