# Save cypher-shell or neo4j command-line output to CSV

**URL:** <https://community.neo4j.com/t/save-cypher-shell-or-neo4j-command-line-output-to-csv/9410>\
**Category:** Import / Export\
**Created:** [August 13, 2019, 5:06pm UTC](https://community.neo4j.com/t/save-cypher-shell-or-neo4j-command-line-output-to-csv/9410 "2019-08-13T17:06:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hbowers](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/hbowers/32/5869_2.png) [@hbowers](https://community.neo4j.com/u/hbowers)\
**Post date:** [August 13, 2019, 5:06pm UTC](https://community.neo4j.com/t/save-cypher-shell-or-neo4j-command-line-output-to-csv/9410/1 "2019-08-13T17:06:36Z")

</div>

I have a query that returns many rows and want to save results in comma- or tab-delimited format for easy ingestion outside neo4j.

Current approach is to feed query to cypher-shell and save output to file:

```auto
cat myfile.cql | cypher-shell -u user -p password --format plain > output_file

```

Query results are not tab- or comma-delimited. How can I make this happen? Is there an alternative approach other than opening the browser, running the query from there, then exporting as CSV?

---

<div class="post-metadata">

**Author:** ![brant\_boehmann](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/brant_boehmann/32/71_2.png) [@brant\_boehmann](https://community.neo4j.com/u/brant_boehmann)\
**Post date:** [August 13, 2019, 5:26pm UTC](https://community.neo4j.com/t/save-cypher-shell-or-neo4j-command-line-output-to-csv/9410/2 "2019-08-13T17:26:51Z")

</div>

Consider using the apoc library and its export to csv procedure:  
[https://neo4j-contrib.github.io/neo4j-apoc-procedures/#export-csv](https://neo4j-contrib.github.io/neo4j-apoc-procedures/#export-csv)

---

<div class="post-metadata">

**Author:** ![hbowers](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/hbowers/32/5869_2.png) [@hbowers](https://community.neo4j.com/u/hbowers)\
**Post date:** [August 13, 2019, 6:35pm UTC](https://community.neo4j.com/t/save-cypher-shell-or-neo4j-command-line-output-to-csv/9410/3 "2019-08-13T18:35:58Z")

</div>

That looks like the very thing I wanted. Will execute. You are a scholar and a gentleman, Brant, and I think you.
