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.
This TXT file, named fruit.txt, has commas that determine where column breaks will be if imported into a spreadsheet.
Save the file as fruit.csv and open it in a spreadsheet program. You'll see the text displayed in columns in the spreadsheet.
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.
- In Microsoft Excel, go to Data, then click From Text.
- Locate and select your TXT file.
- Click Import.
In the Text Import Wizard, Step 1, select Delimited, then click Next.
In the Text Import Wizard, Step 2, select the checkbox for Comma. This adds lines to show you where the column breaks will be.
- Click Next.
In the Text Import Wizard, Step 3, review the formatting and make changes if required.
- Click Finish.
Microsoft Excel displays your data in a spreadsheet. When you save the file, make sure to save it as file type CSV.