How to Convert a TXT File to a CSV File

To convert a TXT (text) file to a CSV (comma separated values) file, you'll need to import the text file into Microsoft Excel and save the file in CSV format. Microsoft Excel has an import wizard to guide you through the process of editing a text file that is being converted to CSV. The step-by-step import wizard provides all the tools for defining each field to be separated by commas. It also provides field formatting tools for defining date and text fields if needed, but the general format is suitable for converting text to simple CSV files.

Business woman working in corporate office.
A woman in an office using a computer.
credit: kasto80/iStock/Getty Images

Step

Launch Microsoft Excel.

Step

Click "Data," then "From Text." The Import Text File dialog box is displayed.

Step

Click on a TXT file and click "Import" to display the Text Import Wizard.

Step

Select the "Fixed width" radio button, then click "Next."

Step

Click on the line in the Data Preview section to create a field-break line. Each break line should be created to separate one field from another. Create all of the break lines necessary to differentiate one field value from another, then click "Next."

Step

Click "Finish," then "OK" to import data.

Step

Click "File," then "Save As" and select "CSV (Comma delimited)" from the Save As Type drop-down menu in the Save As dialog box.

Step

Click "OK" and "Yes" to acknowledge the conversion of your text data to CSV format and save the new CSV file in the specified location.