Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
EILOOP
Advocate I
Advocate I

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]))

v-lili6-msft
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.