For some prototypes, we include CSV files in our delivery. Such files make it easy to change and customize content, without the need of an online database. Of course, editing these files can mess up the whole prototype and may stop it from working entirely. In this guide, we carefully guide you through all steps.
General Information
CSV files store data of a table in plain text. Each line of that text file corresponds to a data record, and the fields in each line are separated by commas.
Since such a file is simple text, you would think that it’s hard to mess up the file. You’re wrong.
To open the CSV file, right-click it. You could choose whether to open it with a spreadsheet application, or just in a simple text editor.
Using a spreadsheet application
Right-click the file and choose the right application (e.g. OpenOffice).
You’ll get the following dialog (or a similar one):
It’s important that you select “Unicode (UTF-8) as character set, check “Comma” as a separator and double quotes (“) as the Text delimiter. Check the preview fields at the bottom of the dialog whether the file will be read correctly.
The opened file will look like this:
Here, you can edit the fields of the CSV file easily. The first row is the column header, so do not modify that one. Make sure that all the fields in columns with a header are filled with the right kind of content. If you add a row with a new plantID, for example, you should also immediately add a name, description, sellValue, and imageFile.
Save the CSV file in the same format as you’ve opened it. Do not save it as a .odt or .xls file, for example.
Using a simple text editor
Right-click the file and choose the right application (e.g. TextEdit, Notepad).
Be sure that it’s opened as plain text. In TextEdit, for example, you can convert it to plain text under Format > Make Plain Text.
If the file is opened correctly, it should look like this:
Note that one text field has quotes while the others don’t. That’s because the text contains a comma, which would mess up the CSV file (the text would be split up in two fields). You can put quotes around the content of any field, even if it’s not necessary. In the example above, however, the text has to have quotes.
Make sure the correct double quotes are used. For example, the following CSV file won’t be read correctly:
The double quotes marked in blue are not the correct double quotes, even if they look similar. Always check that the text file has the right quotes.
Do not add unnecessary spaces before or after the commas, since it may influence the data in between them.
After saving the CSV file, make sure that the file still retains the .csv suffix to make sure that it will load correctly.






