A comma separated values file (CSV) is a plain text file containing a list of data. These files are often used to exchange data between different applications. As an example, databases and contact managers often support CSV files.
These files can sometimes be called character separated values or comma delimited files. They mostly use the comma character to separate (the outline) data, but from time to time they use other characters, as a semicolon. The idea is that you can export complex data from one application to a CSV file and later import the data from that CSV file into another application..
The structure of a CSV file
A CSV file has a fairly simple structure. It is a list of data separated by commas. As an example, suppose you have some contacts in a contact manager and export them as a CSV file. You would get a file containing text like this:
Name, email, phone number, direction
Bob Smith, bob @ example.com, 123-456-7890,123 Fake Street
Mike Jones, mike @ example.com, 098-765-4321,321 Fake Avenue
That is all that a CSV file truly is. They can be more complicated than that and can contain hundreds of lines, more entries on each line or long text strings. Some CSV files may not even have the headers at the top, and some may use quotes to surround each bit of data, but that's the basic format.
That simplicity is a feature. CSV files are designed to be a way to easily export data and import it into other programs. The resulting data is human-readable and can be easily viewed with a text editor such as Notepad or a spreadsheet program such as Microsoft Excel..
How to view a CSV file in a text editor
To view the contents of a CSV file in Notepad, right-click File Explorer or Windows Explorer and then select the command “Edit”.
Notepad may have trouble opening the CSV file if it is very large. For this case, We suggest you use a more capable plain text file editor like Notepad ++. To view a CSV file in Notepad ++ after install it, right-click the CSV file and select the command “Edit with Notepad++”.
You will see the list of data in plain text in the CSV file. As an example, if the CSV file was exported from a contacts program, you will see information about each contact here, with contact details arranged in a new line. If it was exported from a password manager like LastPass, you will see different web portal login entries on their own line here.
In Notepad, the function “Word wrapping” may make it difficult to read the data. Click Format> Text Wrap to turn it off and make each line of data stay on its own line to boost readability. You will need to scroll horizontally to read the entire lines.
How to open a CSV file in a spreadsheet program
You can also open CSV files in spreadsheet programs, which makes them easier to read. As an example, if you have Microsoft Excel installed on your computer, you can just double click a .csv file to open it in Excel by default. If it doesn't open in Excel, you can right click on the CSV file and choose Open With> Excel.
If you don't have Excel, you can upload the file to a service like Google Sheets or install a free office suite like LibreOffice Calc to see.
Excel and other spreadsheet programs present the contents of a .CSV file as if it were a spreadsheet, sorting it into columns.
RELATED: How to export a CSV file from the MySQL command line
How to import a CSV file into an application
If you only want to view the contents of a CSV file or work with it as a spreadsheet, that's all you need to do. Despite this, many CSV files are made to import into other programs. You can export your contacts from Google Contacts, your saved LastPass passwords or a large amount of data from a database program. You can even export CSV from MySQL on command line. The resulting CSV files can be imported into applications that support that data type.
Depending on the application from which you export the data, you may need to choose a CSV format suitable for your target application. As an example, Google Contacts can export contacts in Google CSV formats (for Google Contacts) o CSV from Outlook (for Microsoft Outlook). Either way, you get a CSV file containing the data, but it's arranged in a slightly different way.
In a suitable application, look for the option “to import” O “Import CSV”, which enables you to choose the CSV file to import. As an example, and Microsoft Outlook, you can click File> Open & Export> Import / Export> Import from another program or File> Comma Separated Values to import contacts from a CSV file.
CSV files are something most people never need to worry about. But, if at any time you have needed to obtain information from one application to another, that's what they are for.