Forum Discussion
How do you import txt with tabs?
I am using the import functionality but it's not giving me a choice on the columns. First I select Get Data and chose 'Text/CSV'
.
I then select and open the text file...but only one column appears and it sticks all of the data in the first column. how do I get PowerBI to recognize there are tabs?
Anonymous wrote:I am using the import functionality but it's not giving me a choice on the columns. First I select Get Data and chose 'Text/CSV'
.
I then select and open the text file...but only one column appears and it sticks all of the data in the first column. how do I getPowerBII to recognize there are tabs?
Hi Anonymous ,
Picking up from your follow up question, please have a look at the following screenshots.
1) After you select "Text/CSV", via the Get Data window (depending on what version of Power BI desktop you're using) you should see the "Load/Transform" window. This is your first opportunity to tell Power BI what type of CSV file it's dealing with.
a. The menu option to select different delimiters used to breaks-up / separate CSV data columns should be at the top of the window, in a drop-down called "Delimiter". For your file you need to select "Tab".
b. "File Origin": The CSV encoding format used to encode the CSV can also be important if your CSV file contains special character sets outside of ASCII (e.g. Non-American Standard Code). See below for links which explain this in more detail.
c. I usually hit "Transform Data" at this point to further clean my CSV file.
Load/Transform window
2) If you already have a query underway, then you can access the CSV configuration window via the
d. "Source" step within the "Query Settings pane". This should open the CSV configuration window again (See d. in the below screenshot).
e. the "Delimiter" options can be found at the bottom of this window.
Configuration window for the "Source" transform
If this doesn't solve your problem, there may be an issue with the way your CSV/Text file has been formatted. It may have been corrupted or not saved using a consistent delimiter (like tabs, or commas). If you’re able to post the file or a screenshot of it opened in notepad, one of our PWRBI family community members might be able to spot the issue.
Failing that, if your file opens in Excel and is formatted in columns correct, try saving it as an excel (*.xlsx) file and then importing it into Power BI.
Links to more info on CSVs
General advice on CSVs
https://donatstudios.com/CSV-An-Encoding-Nightmare
w3schools on charsets (i.e. ASCII, Windows-1252, UTF-8)
https://www.w3schools.com/charsets/default.asp
Wikipedia.org article on Comma-separated_values
https://en.wikipedia.org/wiki/Comma-separated_values