cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Encoding=65001 for csv files

Hi guys,

I'm getting my csv data from a folder (7 files) but the entity column has lotta weird symbols. IT works well if i download 1 file or if i do it opening the content column but it does not work if i create a custom column  with Csv.Document([Content]). I've add Encoding=65001 and still not working.....
Here's my code:

let
Source = Folder.Files("C:\Users\Pedro\xxxxx"),
#"Added Custom" = Table.AddColumn(Source, "Custom", each Csv.Document ([Content])), Encoding=65001,
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Name", "Date created", "Custom"}),
#"Expanded {0}" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16", "Column17", "Column18", "Column19", "Column20", "Column21", "Column22", "Column23", "Column24", "Column25", "Column26", "Column27", "Column28", "Column29", "Column30"}, {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16", "Column17", "Column18", "Column19", "Column20", "Column21", "Column22", "Column23", "Column24", "Column25", "Column26", "Column27", "Column28", "Column29", "Column30"})
in
#"Expanded {0}"

Anyone can help please?
Thank you all
Pedro

3 REPLIES 3
Frequent Visitor

I have seen the following cause data to be missing or display incorrectly from the Original CSV file; not confident it will fix your issue but worth a try. Update the ".None" to ".Csv".

When you select the connector for CSV from Get Data it will append "QuoteStyle" with .Csv and NOT .None

 

FROM- #"Added Custom" = Table.AddColumn(Source, "Custom", each Csv.Document([Content],[Delimiter=",", Columns=30, Encoding=1252, QuoteStyle=QuoteStyle.None]))

TO - #"Added Custom" = Table.AddColumn(Source, "Custom", each Csv.Document([Content],[Delimiter=",", Columns=30, Encoding=1252, QuoteStyle=QuoteStyle.Csv]))

Community Support
Community Support

HI  @Anonymous 

You may try this code:

let
Source = Folder.Files("C:\Users\linli\Desktop\daily\2020\0122"),
#"Added Custom" = Table.AddColumn(Source, "Custom", each Csv.Document([Content],[Delimiter=",", Columns=30, Encoding=1252, QuoteStyle=QuoteStyle.None])),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Name", "Date created", "Custom"})
in
    #"Removed Other Columns"

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I did....

let Source = Folder.Files("C:\Users\...\Purchases"), #"Removed Other Columns" = Table.SelectColumns(Source,{"Name", "Date created", "Content"}), #"Added Custom" = Table.AddColumn(#"Removed Other Columns", "Custom", each Csv.Document ([Content])),Delimiter=",", Columns=30, Encoding=1252, QuoteStyle=QuoteStyle.None, #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Content"}), #"Expanded {0}" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column1", "Column2", "Column3", "Column4", ...

Still not working @v-lili6-msft 

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors