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.

Reply
eniX
Helper III
Helper III

QuoteStyle.None doesn't work

 

Sample data look like following:

 

column_1;column_2;column_3;
A;1;1
B;2;2
C;"3;3
D;4;4

 

I would like to load this data and ignore quotes, beause quotes are in the data, it's not a field qualifier.  I tried to use following M code:

= Table.PromoteHeaders(
    Csv.Document
        (File.Contents(file_path),
        [
            Delimiter=";", 
            Columns=3, 
            Encoding=1252, 
            QuoteStyle=QuoteStyle.None
        ]
    )
)

 msdn says:"QuoteStyle.None (default): Field qualifiers are not used. "

 

but when I use it, the third row (C) is not separated properly. All the data resides in the second column ("3;3).

 

Why is QuoteStyle.None not working?

2 ACCEPTED SOLUTIONS

Hi @eniX,

 

I have reported this issue to the Product Team: CRI 78250455. I will update the latest news here.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @eniX. If you look at the latest documentation in the product (by creating a new blank query and typing = Csv.Document), you should see an updated description for QuoteStyle. The MSDN documentation hasn't yet been corrected, but I'm following up on this.

 

Despite its name, the QuoteStyle option in Csv.Document controls how linebreaks within quotes are handled, not whether or not quote characters are supported.

 

To ignore quotes altogether, you'll need to use the Split Column approach suggested by @v-jiascu-msft.

Ehren

View solution in original post

7 REPLIES 7
v-jiascu-msft
Employee
Employee

Hi @eniX,

 

We can do it easily with the built-in function. Please refer to the following details.

Edit Queries -> Home ->Split Column function,

Use Split Column by Delimiter as below:

quotestyle

quotestyle2

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you,

 

I'm aware of the split function, but  I have csv data and I wanted to load it directly as csv and not as text and splitting after...what about QuoteStyle? Is it broken?

Hi @eniX,

 

I have reported this issue to the Product Team: CRI 78250455. I will update the latest news here.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @eniX. If you look at the latest documentation in the product (by creating a new blank query and typing = Csv.Document), you should see an updated description for QuoteStyle. The MSDN documentation hasn't yet been corrected, but I'm following up on this.

 

Despite its name, the QuoteStyle option in Csv.Document controls how linebreaks within quotes are handled, not whether or not quote characters are supported.

 

To ignore quotes altogether, you'll need to use the Split Column approach suggested by @v-jiascu-msft.

Ehren

Thank you for clarification & the trick!

eniX
Helper III
Helper III

no one?

Hi,

 

I Encountered the same issue as You did.  My import is a folder where every day new data is added as a new text file. in that case we can see progress made in time. Because this is 'snapshotting' i'm sure nothing has been changed that would change the graphics in the past.

 

but for every record (its about Purchase Requisitions) there is a short text where they can fill in whatever they want. NOw the standard option in PowerBI will trigger the CSV import. When impporting the table data for the row below is imported in the correct columns until the TXZ01 column. Every other character after the " will be filled in that column. the split of the "| " is not used anymore. somehow the import of CSV cannot cope with an "

 

The table date is as following:

|BANFN |BNFPO|BSART|BSTYP|LOEKZ|STATU|FRGKZ|FRGZU|EKGRP|ERNAM |ERDAT |AFNAM |TXZ01 |MATNR |WERKS|LGORT|MATKL | MENGE|MEINS|BUMNG|BADAT |LPEIN|
|12345678 | 10|NB |B | |B | | |D11 |NAME|06.08.2021| |"GM6,R31_3"",900#,GK RJT OCT,A182M Gr.F5|B41660093|JGER| |PD | 1,00 |ST |0,00 |06.08.2021|1

 

 

The standard CSV Import looks like this:false 2021-09-30_11-45-32.png

 

 

 

 

Because i'm importing from a Folder, there are some extra functions like a Transform function, parameter and Sample files created. In the Transform File function I changed the import From :
 Source = Csv.Document(#"EBAN Parameter",[Delimiter="|", Columns=37, Encoding=1252, QuoteStyle=QuoteStyle.None])

 

To:      Source = Table.FromColumns({Lines.FromBinary((#"EBAN Parameter"), null, null, 1252)})

 

Then in the Import query i added a Split Column:

#"Split Column by Delimiter" = Table.SplitColumn(#"Expanded Table Column1", "Column1", Splitter.SplitTextByDelimiter("|", QuoteStyle.None), {"Column1.1", "Column1.2", ....[until]...., "Column1.38"}),

and then of course changed all the columns and so on to work again.

 

now it shows like:

good 2021-09-30_11-47-31.png

 

 

 

 

CSV files allways are a pain in the ass when there are characters available in columns we can also use as delimiter or as Quotes for Text. Somehow after 3 decades of programming still there is no fundamental change in new software and I'm still creating my own imports as I did 3 decades ago. 

 

Hope this helps solving your issue. Unfortunately the standard CSV import won't work.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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