api - Transform content in table to JSON formatted using PowerQuery -
i new powerquery. import csv using powerquery , need pass content within csv json formatted. use powerquery consume web service api.
how can please?
for example csv has column1-3 , text formatted.
thank peddie
if want convert csv json, apply find/replace plain text - replace delimiter ";" comma "," (or quotes , commas text values). replace new lines square brackets "],[". after embrace double square braces
assume csv-text is
1;2;3 1;2 1 1;2
first replace ";" ","
1,2,3 1,2 1 1,2
then replace new lines "],["
1,2,3],[1,2],[1],[1,2
embrace
[[1,2,3],[1,2],[1],[1,2]]
here example
let src = "1;2;3 1;2 1 1;2", replace_semicolon=text.replace(src, ";", ","), replace_newlines =text.replace(replace_semicolon, "#(lf)", "],["), braces="[["&replace_newlines&"]]", json=json.document(braces) in json
Comments
Post a Comment