jexp / neo4j-shell-tools

A bunch of import/export tools for the neo4j-shell
289 stars 55 forks source link

Use cypher file and export results to csv using pre-existing database? #81

Open sergeiwallace opened 8 years ago

sergeiwallace commented 8 years ago

I have a pre-existing database. How can I use a .cql file to run a query on it and then pipe the results to a csv file? It's unclear to me how to do all of these things together based on the manual.

jexp commented 8 years ago

Hey, you can have your server running on that database or use shell with a db on disk.

You can use bin/neo4j-shell -file run.txt then it connects to a running server and will execute all shell commands in the run.txt file.

sergeiwallace commented 8 years ago

Thanks! My issue is asked in the stack overflow question. The command:

Neo4j> Neo4jShell -file query.cql > out.csv

essentially works. The only problem is that the cypher query output that I write to a csv file isn't in a comma separated format.