Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separator is the source of the name for this file format. A CSV file typically stores tabular data (numbers and text) in plain text, in which case each line will have the same number of fields.

In our Squirro platform, the CSV format is based on specifications mentioned in RFC-4180. In order to upload communities, the following points have to be kept in mind:

  • Separate data fields with a delimiter, a comma.

  • Keep each record on a separate line. Each record must start on its own line.

  • In the first line of the file, include a header with a list of the column names in the file. For a community, the following headers can be passed: Name, Image, Facet_value. The headers are not case-sensitive. Any additional headers that are provided shall be ignored.

  • If no header is included, then the CSV should only contain one column per record which would be the name of the community.

  • Make sure the header list is delimited in the same way as the rest of the file.

  • Remember that the enclosing character (typically double quotes) must be used when required, such as when the delimiter appears in a field.

  • Try not to use any spaces before and after the delimiter (comma).

Examples of correct CSV formats:

a. This will create three communities with name India, Nepal and Switzerland, and facet_values “india“, “nepal“ and “switzerland“.

Code Block
languagenone
name,facet_value
India,india
Nepal,nepal
Switzerland,switzerland

b. This will create three communities with name India, Nepal and Switzlerland.

Code Block
India
Nepal
Switzerland

c. This will create three communities with name India, Nepal and Switzerland, and facet_values “india“, “nepal“ and “switzerland“. The language field will be ignored.

Code Block
languagenone
name,facet_value,language
India,india,Hindi
Nepal,nepal,Nepali
Switzerland,switzerland,Deutsch

Some examples of incorrect CSV formats:

a. The following would be incorrect as it does not include the header containing the name of the columns.

Code Block
languagenone
India,india
Nepal,nepal
Switzerland,switzerland

b. The following would be incorrect as the records are not separated in new lines.

...

languagenone

...

This page can now be found at CSV and Excel Formatting for Communities Upload on the Squirro Docs site.