A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Disclaimer: The site I link below is a non-Microsoft website. The page appears to be providing accurate and safe information. Watch out for ads on the site that may advertise products frequently classified as PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.
Hello ONE_ME,
Thank you for the clear repro.
Rows that merge silently during import are hard to spot, so this is worth clarifying.
Your observation matches longstanding behavior: when CsvStyle is omitted, the engine applies CsvStyle.QuoteAlways. A member of Microsoft Fabric CAT team documented the same result in his in-depth Csv.Document review and also noted that when you pass a column list or table type as the second argument, CsvStyle cannot be set and QuoteAlways applies.
This points to an inaccurate "(default)" marker in the documentation rather than a new parser regression, although only the Power Query product team can confirm the intended default.
To get predictable results, try the following:
- Always set CsvStyle explicitly in the options record instead of relying on the default:
Csv.Document(
File.Contents("C:\Temp\t.csv"),
[Delimiter = ",", Encoding = 65001, CsvStyle = CsvStyle.QuoteAfterDelimiter, QuoteStyle = QuoteStyle.Csv]
)
- If you need column names or types, pass them through the Columns field of the record, for example
Columns = type table [Item = text, Size = text], rather than as the second positional argument. This keeps CsvStyle configurable. - When you connect through Data > Get Data > From File > From Text/CSV, the dialog does not expose CsvStyle. Open Home > Advanced Editor in the Power Query Editor and add the field to the generated Source step.
- Report the discrepancy at the bottom of the Csv.Document page: select No under "Was this page helpful?" and include your repro so the docs team can review the default marker.
I hope this helps. Please feel free to reply if you need further assistance.
Have a nice day.