基础知识:问题:来自Google Adwords的.cvs报告是如何编码的?
详细信息:我尝试使用powerquery从adwords导入.csv,并且在我的生活中,我无法获得"," (逗号)字符将出现在我的导入中。
我的代码:
let
// Get raw file data as txt file,
fnRawFileContents = (fullpath) as table =>
let
EveryLine = Lines.FromBinary(File.Contents(fullpath),1,true,1200),
Value = Table.FromList((EveryLine),Splitter.SplitByNothing())
in
Value,
// Use functions to load contents
Source = fnRawFileContents("C:\Users\Jamie.Marshall\Desktop\Emma\adwordsDoc.csv"),
#"Removed Top Rows" = Table.Skip(Source,1)
in
#"Removed Top Rows"
事实:
答案 0 :(得分:0)
为什么使用行而不是本机csv-parser?
使用Csv.Document(file_content, [Delimiter="#(tab)", Columns=10, Encoding=1200, QuoteStyle=QuoteStyle.None])
喜欢这个
let
file_path = "C:\Users\Jamie.Marshall\Desktop\Emma\adwordsDoc.csv",
file_content = File.Contents(file_path),
csv = Csv.Document(file_content, [Delimiter="#(tab)", Columns=10, Encoding=1200, QuoteStyle=QuoteStyle.None]),
skip_1_row = Table.Skip(csv,1),
promote_header = Table.PromoteHeaders(skip_1_row),
remove_last_2_rows = Table.RemoveLastN(promote_header,2)
in
remove_last_2_rows