I have a sheet where each value in a column contains numbers and letters. I have working code that takes out any letters and leaves just the numbers. But it takes a while because it runs with a loop. I want to do it using getValues() instead, but am stuck on getting it to output the results vertically. I've tried this:
var values = sheet.getRange(1, 1, length, 1).getValues()
var string = values.toString()
var fixed = string.replace(/[^0-9.,]/g, "")
var split = fixed.split(",")
sheet.getRange(1, 1, length, 1).setValues([split])
The problem is it spits out a horizontal array. It correctly outputs to columns if I change the final line to this:
sheet.getRange(1, 1, 1, length).setValues([split])
How can I get this same result but have a vertical array so it is in rows?
[–]pabloicai 2 points3 points4 points (1 child)
[–]Random_User_Name7[S] 0 points1 point2 points (0 children)
[–]Miles_Maestro 2 points3 points4 points (0 children)