How to write match results from .cypher into textfile via cypher shell (Windows)?

135 Views Asked by At

I want to write match results based on cypher code inside a cypher file via cypher-shell into a text file (I am trying to do this on Windows). The cypher file contains:

:begin
match(n) return n;
:commit

I tried to execute:

type x.cypher | cypher-shell.bat -u user -p secret > output.txt

I get no error. But at the end there is just an empty text file "output.txt" inside the bin folder. Testing the cypher code directly in the cypher-shell (without piping) works. Can anyone help, please?

1

There are 1 best solutions below

0
On

consider using the apoc library

that you can export to different formats, maybe it can help you.

  • Export to CSV
  • Export to JSON
  • Export to Cypher Script
  • Export to GraphML
  • Export to Gephi

https://neo4j.com/labs/apoc/xx/export/ --> xx your version Neo4j,example 4.0