Pass hyphen in column name?
ChrisLally opened this issue · comments
Chris Lally commented
Is there a way to pass a hyphen in a column's name?
I added ["hyphen", /^-/] to the patterns list which didn't throw an error anymore, but did skip those columns. Any advice greatly appreciated!
qeet commented
you can quote the column name with single quotes eg:
IMPORTJSONAPI("http:...", "$..", "'col-name-1'")
Chris Lally commented
Worked like a charm! Thanks @qeet!!
Chris Lally commented
I wonder if it's possible to do this automatically if a hyphen is detected in a column name?
Chris Lally commented
Wow I got it!
Just need to add: if(input.includes("-")){var input = "'"+input+"'"} directly under function read_token_(input, i)