I’m working with a Google Sheets file where I need to import data from an external source. The problem is that when the data comes in, it contains unwanted quotation marks and equals symbols that I need to clean up.
When I use just the basic import function, everything works fine and I get all my data, but it has these extra characters I don’t want:
=IMPORTDATA("https://example-api.com/data?format=csv&id=5432")
This brings in all the information but with quotes and equals signs mixed in.
If I try to clean just one type of character, it works but only removes that one character:
=SUBSTITUTE(IMPORTDATA("https://example-api.com/data?format=csv&id=5432"),CHAR(61),"")
This removes the equals signs but I only get one cell instead of all my data.
When I try to remove both types of characters at once, I run into the same issue:
=SUBSTITUTE(SUBSTITUTE(IMPORTDATA("https://example-api.com/data?format=csv&id=5432"),CHAR(61),""),CHAR(34),"")
This cleans both the quotes and equals signs, but again I only get a single cell of data instead of the full dataset.
Right now I’m working around this by importing the raw data first, then using separate formulas to clean each cell:
=SUBSTITUTE(SUBSTITUTE(A15,CHAR(34),""),CHAR(61),"")
This method works but it’s messy and I have to apply it to every single cell. I’d really prefer to handle the cleaning in one step if possible. Is there a way to make the substitute function work with imported data without losing most of my results?