Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello,
I am trying to import Text/CSV file in Power Query, but while doing that I don't have an option to chose delimiter in the import window as it is shown in the following post response:
https://community.powerbi.com/t5/Power-Query/How-do-you-import-txt-with-tabs/m-p/955717#M32980
And there is only one column which I can't split into several columns as there is no delimiter choose option:
Only one column. No delimiter selection
Wrong Source Code
Proper code that I would like to have PQ inserted automatically
And after importing the source code looks like that:
= Table.FromColumns({Lines.FromBinary(File.Contents("C:\Users\MyUserName\Desktop\123.txt"), null, null, 1252)})
But should look like that:
= Csv.Document(File.Contents("C:\Users\MyUserName\Desktop\123.txt"),[Delimiter="#(tab)", Columns=19, Encoding=1252, QuoteStyle=QuoteStyle.None])
Why it can be like that? Why Power Query choses to use Table.FromColumns instead of Csv.Document? Are there any pre-settings required for Text/CSV file itself to be imported and to be able to turn on chose delimiter option?
I agree that is wierd to not see the delimiter field. A sample file that can be used to reproduce your problem might be helpful in figuring out what's going on with that import wizard.
In the mean time, why don't you just write what you think is the proper code for that file yourself?
To start with:
Source = File.Contents("C:\Users\MyUserName\Desktop\123.txt"),
ToCSV = Csv.Document(Source,[Delimiter="#(tab)"])
Of course, you can and probably should add more arguments to the Csv.Document function and add some of the other things that the wizard usually does automatically, like promoting the first row to headers and setting the data types.
Hello
I have the same issue here 04/28/2022, I think something to submit to MS.
As a workaround I use the delimited manual option in Transform Power query after opening the file, as image below maybe it works for you
Regards
Hi @Anonymous
Which connector do you use in power bi?
We use "Text/csv", so to get a query like "Csv.Document(File.Contents(****".
Best Regards
Maggie
Hello @v-juanli-msft I use exactly text/csv but with specific file it doesn't work well as for the other files it's ok
@Anonymous - What does your source data look like?
Please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Import CSV
Hey @Anonymous,
You just need to click on new source - > text/csv and then locate to your file.
Then import screen will be opened where you can select the delimiter of your choice.
You can find the Csv.Document in the source step.
You will get the CSV.document in the source stepe
There is no presetting for this. Please follow the above steps and let me know whether its working for you or not.
If your problem is solved then please accept this as solution.
Thank you
Thank you, however it doesn't help. I tried to make my problem more clear with some pictures, please have a look.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!