There is no formal definition of the CSV format, or at least none that everyone agree to, so different applications have slightly different ideas about the look of such a file. CSV Touch tries to handle as many of those as possible, but it can be a little bit difficult finding out what the problem is if your file doesn’t seem to work.
Before showing some examples, here are a couple of general rules for acceptable files:
- The first line should contain the column titles; they must all be different
- Use quotation marks (“) around a whole text entry if there are quotation marks inside the text entry itself (explaining example below)
- Use quotation marks around a whole entry if the entry contains the delimiter (e.g. a comma) for the file
- No line breaks are accepted, even if the line break is inside quotation marks
- All rows should contain the same number of items
- Max 64 columns and 65536 characters in one single row; no row limit except for the global memory limitation for an application (how many rows this means in real life depends on how long they are; normally thousands of lines is not a problem)
Almost all applications which can export CSV files will automatically produce files fulfilling these rules, so it is rare that you need to know about them.
"Author","Title",Price,"Copies","Part of...",Number,Category,Created "Abbott,E","Flatland",100,1,,,Novel,02/12/1991 "Abell,E","Exploration of the Universe, 2nd Ed.",175,1,,,Physics,02/12/1991
Note that it is OK to have quotation marks around some entries, but not around others (“Author” compared to Physics). However, it is necessary to use them for “Abbot,E” since there is a “,” inside the text entry (Rule 3 above).
Title;Plattform;Price;Bought Advance Wars;GBA;125;15/11/2002 Advance Wars: Dual Strike;DS;328;
Note that it is not necessary to have quotation marks here since there are no “;” inside the text entries. Also note the trailing “;” in the last row which is necessary to indicate that the data in the last column (“Bought”) is empty for this row (Rule 5 above).
Title,Length,Language Three Amigos,99,English Lindsay Anderson's "if...",129,English
The problem here is the last row which uses quotation marks inside the text entry in the first column (Rule 2). The correct row to make sure that the text entry appears with quotation marks around the word if…:
"Lindsay Anderson's ""if...""",129,English
(There is a setting, Keep Quotes, which would make this example work OK, but for almost all files using Keep Quotes will lead to errors.)
"Austen,J",Emma,"2007" "Austen,J","Pride and Prejudice",2006,19th century
Here there are two problems. The first is the fact there are no column titles, i.e. an initial row with those is missing (Rule 1 above):
The second problem is in the “Emma” row. There are no notes for this novel, but to indicate this the row needs a terminating “,” to make all the rows have the same number of items (Rule 5):
Actor/Actress|Line|Movie "Clark Gable"|"Frankly, my dear, I don't give a damn!"|"Gone With the Wind"
Here the problem is the line break inside Clark Gable’s line; it is inside quotation marks but this is still illegal (Rule 4). Correct version:
"Clark Gable"|"Frankly, my dear, I don't give a damn!"|"Gone With the Wind"