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.

Csv.Document() does not handle Escape Character '\'

Hi,

 

PowerBI fails to separate columns correctly in the Csv.Document() command. I use \ as an escape character in the Csv file. I have several text strings that end with a " sign, and whenever we try to import this into PowerBI it will not see the column separator following the " and parse the text in the next column into the previous column. As an example:

 

Column 1; Column 2; Column 3

Random text ending with \"; Text in next column; Blank

 

gets imported as 

 

Column 1: Random text ending with "; Text in next column

Column 2: Blank

Column 3: Blank

 

I have tried several alternative Escape Characters, but have not found one that imports the text correctly.

Status: New
Comments
v-chuncz-msft
Community Support

@trert 

 

The latest version of Power BI Desktop works fine for me. You may try it.

 

trert
Regular Visitor

I am already using the latest version: Version: 2.84.981.0 64-bit (august 2020).

 

This is an example of a line that does not import correctly. In PowerBI, the bold text is put into the same column.

 

"2851916";"9000";"";"";"2017-09-18 19:52:10.000";"87908642";"";"Spec; 20-12672, Cable CAN 6\"";"";"00047713";"1";"00000000100000000000000000000000";"";"79252901";"0";"";"00047713";"2019-03-28 18:50:20.000";"87908642";"";"";"112";"";",2853935,";"2473431"

 

My Csv.Document() Power Query code looks like this: Csv.Document(#"Navigation 1", [Delimiter = ";", Columns = 25, CsvStyle=CsvStyle.QuoteAfterDelimiter, QuoteStyle=QuoteStyle.Csv])

 

#"Navigation 1" points to the Csv file in our Azure Blobstore. I have tried all possible combinations of CsvStyle and QuoteStyle.

RonaldMussche
Frequent Visitor

I have the exact same problem here. Using the latest version of power bi desktop.

Version: 2.86.727.0 64-bit (October 2020)

 

Any ideas?