Change delimiter type when exporting data into csv

Hello,

is it possible to change delimiter type when exporting data from Neo4j into csv file?

My current export query use the comma "," as delimiter between the requested information (EntityLabels and Entity):
<CALL apoc.export.csv.query("MATCH (e:entity) WHERE e.name = 'Daniel' RETURN labels(e) AS EntityLabels, e.name AS entity", "results.csv", {})>

However I would need to use vertical bar "|" (as a delimiter) instead. I tried to run the following query but it did not help:
<CALL apoc.export.csv.query("MATCH (e:entity) WHERE e.name = 'Daniel' RETURN labels(e) AS EntityLabels, e.name AS entity", "results.csv", {d: '|'})>

Can I kindly ask you if it is possible to export data from Neo4j using a different delimiter? If so, are there any suggestions how to run such query?

Please note I am currently using Neo4j 4.0.4.

Thank you very much for any help!

Daniel

I am not entirely sure. Have you checked the documentation here? I didn't see anything about changing the file delimiter.

Is there a particular reason | works better than ,? I am just curious as to why you would prefer that separator.

When in doubt, always check the source code :slight_smile:

It seems that the correct parameter name is actually delim judging by this code:

1 Like