CSV isn't well suited for that sort of nested data.
Either you would have to create two csv files: prodcuts.csv
and features.csv
where entries from features.csv
pointing to entries in products.csv
, like in a relational database or you would have to flatten the feature list into a single string, so that the CSV would look like this:
"product_name", "product_color", "features"
"SomeProductName", "Black", "this is feature 0|this is feature 1|this is feature 2"
"AnotherProductName", "White", "this is feature foo|this is feature bar"
However the flatten function must make sure that the delimiter isn't part of the data itself.
I would encourage you to keep it xml
, as it is best suited for nested data.