Forum Discussion
Import correctly CSV into power query
- Anonymous1 year ago
I can import the file using this MCode:
= Csv.Document(File.Contents("Z:\test.csv"),[Delimiter=";", Encoding=1201, QuoteStyle=QuoteStyle.Csv])
Or do I miss something?
- 1 year ago
Victory it works, so what differ between what I did and what you did is the encoding number you used "1201"
Could you explain me how you selected this "encoding system" ?
Hi PierreL69
I managed to import after changing the encoding in VS code
In VS code, open the file.
Click the encoding label in the bottom-right corner (e.g., "UTF-32 BE").
Choose "Save with Encoding" → UTF-8.
Save and re-import the csv to Power BI.
It still looks strange, but I assume that's because of the encryption you added?
This can also be done in notepad++
Open the CSV file in Notepad++.
Go to Encoding in the top menu.
Select Convert to UTF-8.
Save the file.
I hope this helps, please give a thumbs up and mark as solved if it does, thanks!
Huum, I haven't tried your solution yet.
The CSV file will be processed by someone else, someone who is not very good at this kind of thing/manipulation...
For info, I have not added any encoders or anything else, this CSV file is exported as isit is from a website with a MySQL database in the background.
What I want is for this person to upload the CSV file as is it is to a SharePoint, and then for me to import it automatically via Power Query.
Could what you mentioned be done via Power Query (automatically)?
I would like there to be as little manual handling as possible, especially for the person who will have to extract the CSV file every time an update is needed.
- wardy9121 year agoSuper User
No, unfortunately it can't. Notepad++ will be your easiest option.