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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Oguy
Regular Visitor

Get Data From Text file- Text file which start by "PK" do not work.

When a text file start by PK. The options do not displayed. I don't figure why.

Detail :

Case 1 file start with "PK" Don't work

My file :

 
Capture d’écran 2024-11-16 à 19.24.35.png

Loading in power BI Throught Get Data -> Txt file/csv

There is a problem because it does not display any options.

Capture d’écran 2024-11-16 à 19.24.47.png

Case 2 file start by "P" Work

My file :

Capture d’écran 2024-11-16 à 19.25.25.png

Loading in power BI Throught Get Data -> Txt file/csv:

Capture d’écran 2024-11-16 à 19.25.57.png

In that case, no problem and the option menu is displayed.

1 ACCEPTED SOLUTION
ZhangKun
Super User
Super User

PK is the beginning of a zip file (xlsx files are actually zip files), which you can check in section 4.2 of the .ZIP File Format Specification.

Why does Power Query do this? I guess it's to prevent some people from accidentally changing .xlsx files to .csv files. In fact, if you change the suffix of the .xlsx file to the suffix of the .csv file (change ".xlsx" to ".csv"), Excel can still open it correctly.

Back to the real world, only regions that only use English letters have a small chance of encountering this problem (so, I guess Microsoft will not fix it), because the beginning of "PK" in many regions (such as Chinese and Russian) uses multi-byte characters, and it is difficult to encounter "PK".

Solution to the problem: manually write the expression to import csv/txt files, or do not use ANSI encoding (I reproduced your problem using code page windows-1250).

View solution in original post

6 REPLIES 6
ZhangKun
Super User
Super User

PK is the beginning of a zip file (xlsx files are actually zip files), which you can check in section 4.2 of the .ZIP File Format Specification.

Why does Power Query do this? I guess it's to prevent some people from accidentally changing .xlsx files to .csv files. In fact, if you change the suffix of the .xlsx file to the suffix of the .csv file (change ".xlsx" to ".csv"), Excel can still open it correctly.

Back to the real world, only regions that only use English letters have a small chance of encountering this problem (so, I guess Microsoft will not fix it), because the beginning of "PK" in many regions (such as Chinese and Russian) uses multi-byte characters, and it is difficult to encounter "PK".

Solution to the problem: manually write the expression to import csv/txt files, or do not use ANSI encoding (I reproduced your problem using code page windows-1250).

Anonymous
Not applicable

Try clicking on that image of the txt file in the window.

 

--Nate

Oguy
Regular Visitor

Yes i'm sure. I created them from scratch in .txt. Super interesting, so it may be a Power BI detection bug. 

Cannot reproduce

 

lbendlin_0-1731849946388.png

 

On my version of power bi : 2.138.782.0 64-bit (novembre 2024

i go directly there inside my PK file i try with your : it's :

"PK file"

Capture d’écran 2024-11-17 à 22.15.21.png

 

Thank you for your investigation. 

lbendlin
Super User
Super User

are you sure these are text files?  PK are the initials of the creator of the ZIP file format...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors