Data Import & Export

How to Import Fixed-Width Text with Literal Quotes into Excel

Adam DavisAdam Davis Nov 2, 2026 869 views

Question details

The user needs a way to import fixed-width text files containing literal double quotes into Excel without the wizard applying standard CSV parsing rules.

How to Import Fixed-Width Text with Literal Quotes into Excel
Product
Excel
Device & OS
not provided
Scenario
Importing a text file into a spreadsheet where the data is structured by fixed character widths but contains internal double quotes.
Observed behavior
Excel's default From Text/CSV wizard treats stand-alone double quotes as text qualifiers, incorrectly combining lines or altering the fixed-width data structure.
Before you start

Ensure you have the exact file path of your source text file ready, and make a note of the character positions where your fixed-width columns need to be divided.

Solution 1Recommended

Use Power Query to Bypass CSV Quoting Rules

This method forces Excel to read the text file line-by-line in raw format, completely bypassing the default CSV quotation parsing that causes data merging.

By utilizing the Lines.FromBinary function in Power Query, Excel will treat every row exactly as it is written in the source file. This preserves all literal quotes.

1
Create a Blank Query

In Excel, navigate to the Data tab, click on 'Get Data', select 'From Other Sources', and choose 'Blank Query'.

2
Enter the M-Code

Click on 'Advanced Editor' in the Home tab. Replace the existing code with: Table.FromColumns({Lines.FromBinary(File.Contents("C:\your_file_path\quotes.txt"), null, null, 65001)})

3
Split Column by Position

Select the newly created column. Go to Home > Split Column > By Positions, and type in the specific character lengths where the columns should divide.

4
Remove Changed Type Step

Look at the 'Applied Steps' pane on the right side. If there is a step named 'Changed Type', click the 'X' next to it to remove it. This ensures all values remain as verbatim text.

5
Load the Data

Click 'Close & Load' in the top-left corner to import the correctly formatted data into your Excel worksheet.

Use Power Query to Bypass CSV Quoting Rules
Modify the File Path: Remember to replace "C:\your_file_path\quotes.txt" in the code with the actual drive and folder path to your source file.
Free Microsoft Office alternative

Try WPS Office for Seamless Data Handling

If you frequently struggle with Excel's complex data import rules and Power Query configurations, WPS Office provides a lightweight, highly compatible, and user-friendly alternative. WPS Spreadsheet supports robust data processing and traditional text import wizards that are easy to configure.

Fully compatible with Microsoft Excel file formats (.xlsx, .xls, .csv).Intuitive traditional Text Import Wizard to easily handle fixed-width data without advanced coding.Lightweight and fast, handling large datasets efficiently.Free to use with a familiar interface, requiring no steep learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel mess up my fixed-width text import?

Excel's modern 'From Text/CSV' wizard automatically applies standard CSV quoting rules. If your fixed-width file contains stand-alone double quotes, Excel misinterprets them as text qualifiers, causing it to merge multiple lines or incorrectly shift columns.

Can I use the traditional Text Import Wizard in Excel instead of Power Query?

Yes. You can enable the legacy Text Import Wizard in Excel by going to File > Options > Data, and checking 'From Text (Legacy)' under the 'Show legacy data import wizards' section. However, depending on your exact data structure, the Power Query bypass method is often more reliable for literal quotes.

What does the 65001 code mean in the Power Query M-code?

The number 65001 is the Windows code page identifier for UTF-8 encoding. Including this in the Lines.FromBinary function ensures that any special characters in your text file are read and displayed correctly.