Search code examples
csvconventions

TSV: Conventions for lists as values


Are there any conventions or is there any particularly good choice regarding the separator of a list as a single value/cell in a .tsv file e.g. using ,:

Column_A    Column_B    Column_C
Value_1    Value_2    Value3.1, Value3.2, Value3.3

Solution

  • CSV/TSV is intended to be used for two-dimensional, tabular data. Therefore, I would suggest a different approach:

    Column_A   Column_B    Column_C
    Value_1    Value_2     Value3.1
    Value_1    Value_2     Value3.2
    Value_1    Value_2     Value3.3
    

    Alternatively, use a more flexible format like JSON.

    {"A": "Value_1", "B": "Value_2", "C": ["Value 3.1", "Value 3.2", "Value 3.3"]}