How to convert TXT to CSV

How to convert TXT to CSV How to convert TXT to CSV

TXT is one of the most popular text document formats on the market, working with a wide variety of Windows tools. Yet, things aren't too simple when it comes to editing a TXT file that stores a lot of tabular data, such as numbers and text. One solution would be to convert your TXT file to CSV, a file format that's more reliable and easier to handle. CSV's data exchange capabilities are regularly employed in various types of business, customer or scientific programs.

In a previous guide, I showed you how to convert an ICS file to the CSV format. Now, I will teach you how to immediately convert a TXT document to the CSV format, with minimum effort and without quality loss. Even though you can find various online solutions for completing the aforementioned tasks, I wouldn't recommend trying any of them, especially if the files in question need to remain private, as there's a risk that your documents might end up on the web for anyone to see. Another way to convert a TXT file to the CSV format is by changing the extension of the input document or by using Microsoft Office Excel.

Tutorial assets

You will need to download the following software to follow along with this tutorial.

Changing The Extension

This solution is clearly the easiest one as it doesn't require you to install any third-party tools and can be done directly from the Windows File Explorer. But there's a catch: the TXT file needs to have commas which determine where column breaks will be if imported into a spreadsheet document. If your TXT file meets the criteria, then this is the right solution for you: right-click the TXT file, choose the "Rename" option, alter the extension from TXT to CSV, and hit the Enter key. Here's an example:

TXT File Before RenamingTXT File Before Renaming

CSV File After ConversionCSV File After Conversion

Using Microsoft Office Excel

Microsoft Office Excel is one of the most popular spreadsheet editors on the market. This utility provides you with multiple features for making calculations and creating charts, supports programming through Microsoft's Visual Basic for Applications (VBA), is compatible with various file formats, and so much more. Since both TXT and CSV formats are supported by the program, you can use it to make the necessary conversion. Microsoft Office Excel provides you with a special import option which makes it possible to convert TXT files to the CSV format. Here's what you need to do:

Step 1

Launch Microsoft Office Excel on your PC. Go to Data -> From Text and import your TXT file. Select the "Delimited" option and click the "Next" button.

Importing TXT In Excel Step 1Importing TXT In Excel Step 1

Step 2

Select the "Comma" option. By doing so, lines will be added to show where the column breaks will be. Click the "Next" button.

Importing TXT In Excel Step 2Importing TXT In Excel Step 2

Step 3

See if the results meet your requirements and alter the importing settings if necessary. Click the "Finish" button once you're happy with the results.

Importing TXT In Excel Step 3Importing TXT In Excel Step 3

Step 4

Microsoft Office Excel will display your data in a spreadsheet. Save the document as a CSV file from the main menu of the tool.

Conclusion

Undoubtedly, converting TXT documents to the CSV format is quite easy, but which alternative will you choose? Will you use an online service, manually change the file extension or use Microsoft Office Excel? Let us know in the comments section below.

Alternative downloads

Comments