I'm importing a .csv file with the IMPORTDATA
function. The separator is ;
and decimal char ,
on which Google Sheets automatically applies a text to column. I guess this is the expected behavior from IMPORTDATA
but as a result, my file is not correctly parsed.
I've tried to use the substitute function on ,
with .
but I guess that the text to the column is applied within the IMPORTDATA
function.
=ARRAYFORMULA(SPLIT(SUBSTITUTE(IMPORTDATA("https://drive.google.com/uc?export=download&id=1hosZrfgrKnJJgXkgmPZSKdFoYV_AxKJS"), ",", "."), ";"))
Is there any way to import a CSV with ;
as a separator and ,
as a decimal symbol using a single formula?
I've seen solutions using multiple sheets but I'd like to keep it simple.
答案 0 :(得分:0)
=ARRAYFORMULA(SPLIT(SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(IMPORTDATA(
"https://drive.google.com/uc?export=download&id=1hosZrfgrKnJJgXkgmPZSKdFoYV_AxKJS")), ,
999^99))), " ", "."), ";"))
补偿以空格分隔的值:
=ARRAYFORMULA(SUBSTITUTE(SPLIT(SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(SUBSTITUTE(
IMPORTDATA("https://drive.google.com/uc?export=download&id=1hosZrfgrKnJJgXkgmPZSKdFoYV_AxKJS"),
" ", "♠")), , 999^99))), " ", "."), ";"), "♠", " "))