What Is a CSV File?
A CSV file is a comma-separated values file. It’s a plain text file that can contain numbers and letters only, and structures the data contained within it in a tabular, or table, form. Files ending in the CSV file extension are generally used to exchange data, usually when there’s a large amount, between different applications. Database programs, analytical software, and other applications that store massive amounts of information (like contacts and customer data), usually support this format. A comma-separated values file might sometimes be referred to as a character-separated values or comma-delimited file, but regardless of how someone says it, they’re talking about the same format.
How to Open a CSV File
Spreadsheet software is generally used to open and edit CSV files, such as Excel or the free OpenOffice Calc or WPS Office Spreadsheets. Spreadsheet tools are great for CSV files because the data contained in the file is usually going to be filtered or manipulated in some way. To view and/or edit your CSV file online, you can use Google Sheets. To do that, visit that page and select the folder icon to browse your computer or Google Drive for the file. You can also use a text editor, but large ones will be very difficult to work with in these types of programs. If you want to do this, see our favorites in this Best Free Text Editors list. Like mentioned above, Excel supports CSV files, too, but the program isn’t free to use. Even so, it’s probably the most commonly used program for viewing and editing CSV files. Another way to “open” a CSV file is to import it. You’d do this if you want to use the data from the file in an application that isn’t really meant for editing, but for viewing/using the content. Contact information is the most obvious example; you can import contacts into your Google account, for instance, to sync the contact details from the CSV file with Gmail. In fact, lots of email clients support exporting and importing contact information via the CSV format, including Outlook, Yahoo, and Windows Mail.
How to Convert a CSV File
Since CSV files store information in a text-only form, support for saving the file to another format is included in lots of different online services and downloadable programs. All the desktop programs mentioned above can convert a CSV file to Excel formats like XLSX and XLS, as well as to TXT, XML, SQL, HTML, ODS, and others. This conversion process is usually done through the File > Save as menu. You can also use Google Sheets. From the File > Download menu, pick XLSX, ODS, PDF, or any other supported format. There are also some free file converters that run in your web browser, like Zamzar for instance, that can convert CSV files to some of the formats listed above as well as to PDF and RTF. The CSVJSON tool (guess…) converts CSV data to JSON, super helpful if you’re importing massive amounts of information from a traditional application into a web-based project.
Still Can’t Open It?
CSV files are deceptively simple. As straightforward as they are at first look, the slightest misplacement of a comma, or a basic confusion like the one discussed below, can make them feel like rocket science. Keep in mind that you might not be able to open the file or read the text within it, for the simple reason that you’re confusing another file for one in the CSV format. Some files share some of the same file extension letters but aren’t actually in the same format, or even a remotely similar one. CVS, CVX, and CV are just a few examples where the files probably can’t open in a spreadsheet program even though the suffix looks a lot like CSV. If this is the case with your file, research the real file extension on Google or here on Lifewire, to see its compatible openers or converters.
Important Information on Editing CSV Files
You’ll probably only encounter a CSV file when exporting information from one program to a file, and then use that same file to import the data into a different program, especially when dealing with table-oriented applications. However, you may at times find yourself editing a CSV file, or making one from scratch, in which case the following should be kept in mind: A common program used to open and edit CSV files is Excel. Something important to understand about using Excel, or any other similar spreadsheet software, is that even though those programs appear to provide support for multiple sheets when you’re editing a CSV file, the CSV format does not support “sheets” or “tabs,” so data you create in these additional areas won’t be written back to the CSV when you save. For example, let’s say you modify data in the first sheet of a document and then save the file to CSV—that data in the first sheet is what will be saved. However, if you switch over to a different sheet and add data there, and then save the file again, it’s the information in that recently-edited sheet that will be saved. The data in the first sheet will no longer be accessible after you’ve shut down the spreadsheet program. It’s really the nature of the spreadsheet software that makes this mishap confusing. Most spreadsheet tools support things like charts, formulas, row styling, images, and other things that simply can’t be saved under the CSV format. There’s no problem, so long as you understand this limitation. This is why other, more advanced table formats exist, like XLSX. In other words, if you want to save any work beyond very basic data changes to a CSV, don’t use CSV anymore—save or export to a more advanced format instead.
How CSV Files Are Structured
It’s easy to make your own CSV file. Just get your data sorted how you want in one of the tools mentioned above, and then save what you have to the CSV format. You can also create one manually, yes—from scratch, using any text editor. Here’s one example: What you see in the example above is how the data would appear if the CSV file were opened in a text editor. However, since spreadsheet software programs like Excel and OpenOffice Calc can open CSV files, and those programs contain cells to display information, the Name value would be positioned in the first cell with the John Doe in a new row just below it, and the others following the same pattern. If you’re embedding commas or using quotation marks in your CSV file, read edoceo’s and CSVReader.com’s articles for how you should go about that.
How do I export my iPhone contacts to a CSV file? Export contacts from an iPhone using a third-party app such as Export to CSV. In the Export to CSV app, select Begin Exporting > + > Edit Column Data > choose a source > Export. How do you read a CSV file in MATLAB? To read a CSV file in MATLAB, drag and drop the CSV file in any folder on the MATLAB path. Then, in the MATLAB Command Window, type m = csvread(‘name_of_file.dat’); substituting the name of the CSV file for name_of_file.dat.