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

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors