A text file is a standard text document that contains plain text and has no additional formatting. Text files are compatible with most of the devices and they will have a .txt extension. Whereas CSV (Comma Separated Value) files will have more specific formatting elements. Sometimes a user gets a TXT file from the website rather than the CSV file. Just changing the extension of the file doesn’t help much. So, the user needs to convert the TXT file into a CSV file by themselves.
Converting a TXT File into a CSV File by Using Excel
Excel can open both TXT and CSV files, which is why it is easier to open one format and then save it as another. However, for opening a TXT file, there are several steps that you can configure before it opens in a spreadsheet. If the user is able to select the correct options, then the columns and rows will be in a good shape just like the user want it to be. Follow the below steps to open a TXT file and save it as a CSV file:
- Open your Excel by double-clicking the shortcut on the desktop. You can also search it through the Windows search feature.
- Click on the Open, then choose the Browse option and now search for the TXT file that you want to convert. Select the file and click on the Open button.
Note: If you are unable to find a file, just choose the All Files option.
- Now in the Text Import Wizard, choose the Delimited option so that it will consider the tabs and commas to separate each field. Click on the Next button to move to the next step.
- For Delimiters, you can choose the option that you used in the TXT file for separating. If data are separated by Comma, then choose the Comma option and so on. Click on the Next button again.
Note: In our case, the data were separated by Tab.
- For the final step of the Wizard, you can choose what kind of data is in each column. If you are not sure or find the preview good enough then choose the General option which will automatically adjust it.
- Now click on the File menu at the top left, then choose the Save As option and select the location where you want to save the file. Make sure you select the CSV (Comma delimited) as the file format. Name the file and click on the Save button.
- It will save the file as a CSV into the path you provided.
Converting a TXT File into a CSV File by Using Online Site
If you don’t have the Excel installed on your system, then you can use the online method for conversion. However, online methods may not work as well as the Excel method. Each website will process the conversion differently. It is best to use the online site method for simple files rather than complicated ones. Follow the below steps to try it out:
- Open your browser and go to the Convertio site. Click on the Choose File and select the TXT file that you want to convert.
Note: You can also just drag and drop the file over the button.
- Make sure that CSV is selected as output and click on the Convert button to start conversion.
- After the conversion, click on the Download button to save the file to your system.