Convert a TXT file to CSV format

Convert a TXT file to CSV by changing the file extension, or importing the TXT data. Xero uses data in CSV format in bank statement imports, invoice imports, and more.

Save .txt file extension with .csv extension

The easiest way to convert a TXT file to a CSV file is by saving the TXT file with a .csv file extension.

Example

This TXT file, named fruit.txt, has commas that determine where column breaks will be if imported into a spreadsheet.

Image showing TXT file.

Save the file as fruit.csv and open it in a spreadsheet program. You'll see the text displayed in columns in the spreadsheet.

Image showing CSV file.

If this method doesn't give you the result you need, try importing the TXT data into CSV format.

Import TXT data into CSV

This example uses Microsoft Excel, but you can use any spreadsheet program compatible with TXT and CSV format files.

  1. In Microsoft Excel, go to Data, then click From Text.
  2. Locate and select your TXT file.
  3. Click Import.
  4. In the Text Import Wizard, Step 1, select Delimited, then click Next.

    Image showing text import wizard step 1.

  5. In the Text Import Wizard, Step 2, select the checkbox for Comma. This adds lines to show you where the column breaks will be.

    Image showing text import wizard step 2.

  6. Click Next.
  7. In the Text Import Wizard, Step 3, review the formatting and make changes if required.

    Image showing text import wizard step 3.

  8. Click Finish.
  9. Click OK.

    Image showing text import wizard confirmation.

  10. Microsoft Excel displays your data in a spreadsheet. When you save the file, make sure to save it as file type CSV.

    Image showing .csv file extension selected.

Learn more