jexp / neo4j-shell-tools

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

cypher file option?! #46

Open davidhbigelow opened 9 years ago

davidhbigelow commented 9 years ago

It does not appear to be possible to reference a cypher file for the command line instead of the cypher statement directly.

Also - the cypher statement appears to only work if on the SAME LINE as the command line... So coping and pasting from a human readable form to command line -- or a shell file -- hurts (a lot).

jexp commented 9 years ago

Both great ideas

I want to extend these tools massively anyway

Michael

Von meinem iPhone gesendet

Am 18.10.2014 um 08:11 schrieb David Bigelow notifications@github.com:

It does not appear to be possible to reference a cypher file for the command line instead of the cypher statement directly.

Also - the cypher statement appears to only work if on the SAME LINE as the command line... So coping and pasting from a human readable form to command line -- or a shell file -- hurts (a lot).

— Reply to this email directly or view it on GitHub.

davidhbigelow commented 9 years ago

I am working on a very simple generator using Tcl -- Yea I know... :( - testing similar approach for a more scriptable importer. (bouncing ideas around with Dave Fauth a bit).

BUT works pretty well so far... Still playing around...

[image: Inline image 1]

On Sat, Oct 18, 2014 at 8:35 PM, Michael Hunger notifications@github.com wrote:

Both great ideas

I want to extend these tools massively anyway

Michael

Von meinem iPhone gesendet

Am 18.10.2014 um 08:11 schrieb David Bigelow notifications@github.com:

It does not appear to be possible to reference a cypher file for the command line instead of the cypher statement directly.

Also - the cypher statement appears to only work if on the SAME LINE as the command line... So coping and pasting from a human readable form to command line -- or a shell file -- hurts (a lot).

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/jexp/neo4j-shell-tools/issues/46#issuecomment-59635107 .

David Bigelow Simplified Logic, Inc. C: 317-431-5454

sergeiwallace commented 8 years ago

Has the feature allowing cypher query files been implemented yet? I have a ton of cypher query files that I'd like to run (and export results to csv) with a (Windows) batch script.

jexp commented 8 years ago

In shell you should be able to just use neo4j-shell --file import.cypher

sergeiwallace commented 8 years ago

Can you use your cypher-import tool with cql/cypher query files though? For example, would the following command work?

Neo4jShell> import-cypher -o out.csv query.cql

where the query.cql file queries an already loaded database (i.e. not using your -i flag) and the returned rows are piped to the out.csv file.

jexp commented 8 years ago

no, you would have a import.txt file that contains the commands

import-cypher -o out1.csv MATCH ....
import-cypher -o out1.csv MATCH ....

If you have the same query repeatedly executed with different parameters you can use -i in.csv