Converting text files to Excel splits delimited data into columns and rows that Excel can sort, filter, and analyze. The right approach depends on your file structure — comma-separated, tab-separated, pipe-delimited, or fixed-width.

Open a CSV File Directly in Excel

For comma-separated .csv files, simply open them in Excel without using any import wizard. Excel automatically splits values on commas and places each field in its own column. If special characters appear garbled, the file uses UTF-8 encoding but Excel defaulted to a different encoding — use the import method to specify encoding explicitly.

Import Using Data, Get Data, From Text/CSV

For .txt files or CSV files with encoding or delimiter issues: go to Data, then Get Data, then From Text/CSV. Select your file. Excel auto-detects the delimiter and encoding — adjust both dropdowns if needed. Choose Load to import directly, or Transform Data to clean the data in Power Query before importing. This method handles tab, comma, semicolon, pipe, and custom delimiters with explicit encoding selection.

Text Import Wizard for Older Excel Versions

In Excel 2016 and earlier: go to Data, then From Text. The Text Import Wizard opens. Step 1: choose Delimited or Fixed Width. Step 2: select your delimiter. Step 3: set the data type for each column. Click Finish to load the data into Excel.

Convert Using Python

import pandas as pd
df = pd.read_csv("data.txt", sep="\t", encoding="utf-8")
df.to_excel("output.xlsx", index=False)

Python with pandas handles any text file format, encoding, and delimiter combination. Change sep to the delimiter used in your file — tab for TSV files, comma for CSV, pipe for pipe-delimited. The output Excel file opens directly in Excel with all data properly formatted.

Frequently Asked Questions

What if my text file has no consistent delimiter?

Use Excel Fixed Width option in the Text Import Wizard. This defines column breaks by character position rather than a delimiter character. Click where you want column breaks in the data preview window to set them manually. This works for fixed-format text reports where each field occupies a defined number of characters.

How do I import a text file and keep leading zeros in Excel?

In the Text Import Wizard Step 3 or in Power Query, set the column data type to Text instead of General or Number. This preserves leading zeros in product codes, postal codes, phone numbers, and other numeric strings that must not be treated as integers.