ASCII delimited (CSV)
ASCII delimited (aka comma delimited, aka comma-separated values) is a much used exchange file format that is used and recognized by many database programs.
The paragraphs below explain the CSV format for import with Designer or import.exe. CSV files to be imported with importtool.exe or Collections however, must have a first row containing the English field names pertaining to their columns and any field mapping in the import job is ignored. See The Import tool: create and update records in the Collections online Help for more information about those CSV requirements.
For execution with ImportTool, import jobs can still be made in Designer, but not all options are supported in importtool.exe currently: please see the full topic for more information.
File layout
An ASCII delimited file is a text file with the extension .csv. All fields of a record are on one line, separated typically by commas*. If commas (or the separator character that you specify) or cr/lf (carriage return and line feed) characters occur in a field, that field must be embedded in double quotes. Double quotes that occur in a field must be escaped by being doubled: "", but when you export from Collections, this escaping is automatically applied, so you can use double and single quotes in field contents in your application normally. The fields do not have a name; instead they have a serial number, the first field in each line being 01, the next 02, and so on. The field sequence is always the same. Repeated fields do typically not occur.
Example:
"954",214,"libraries, museums and conservation"
"9541",12,"cultural organization"
"9542",431,"libraries, public libraries"
"9543",521,"archives (public)"
"9544",3254,"museums"
"9545",2345,"art galleries, art libraries, etc."
"9546",8532,"botanical gardens and zoos"
ASCII delimited files may also have a first line that does not contain field values, but the names of the exported fields, e.g. "author","copy_number","title". This is for instance the case when you export to .csv file using the Export functionality in a Collections application. But these field names are only included to document the meaning of the exported fields, they have no relevance for the tag mapping, as explained below.
Do note that such a first line is imported as a record too! So before importing a .csv file, you should open it in a text editor and remove any first line containing field names.
Conversion
With Designer, these files can only be imported, not exported; export is not possible because this file format is not suitable for repeated fields. But you can export to this format from a Collections application; then you can choose between exporting only the first occurrence of a repeated field and merging all occurrences of a field.
This type of exchange file has no field names. Instead, the fields are numbered. For the tag mapping in an import job, you enter the serial numbers of the fields in the import file as source tags, and the Collections field tags as destination tags.
Example of a tag pair definition:
01 |
dr |
02 |
di |
03 |
na |
04 |
ve |
05 |
si |
06 |
ty |
07 |
da |
08 |
de |
If you do not want to import a certain field from a comma-separated file, then leave its Destination field in the mapping empty. (Do not map it to <null>, as that will import the relevant field into "tag" <n.)
* You may specify custom field and record separator characters, if the exchange file format requires it.