cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to load csv with windows scheduler?

Hello,
I am newbie with neo4j. I can load csv with cypher-shell.bat in powershell or load csv with neo4j web UI successful. I want to load csv that can be run with windows scheduler. Can I run load csv with .bat and windows scheduler or does someone have suggestions? Thank you.

I load csv with powershell like below:

\bin> .\cypher-shell.bat -a bolt://localhost:7687 -u neo4j -p password
neo4j>:begin
neo4j#

LOAD CAV WITH HEADERS FROM 'file://test.csv' as line
MERGE (n:n{n:line.n})
MERGE (m:m{m:line.m})
MERGE (n) -[r:TO{r:line.r}]->(m)
;
1 ACCEPTED SOLUTION

Create the file(s) with your cypher. I used PowerShell to show this. The | before the .\bin\cypher... is the pipe character

PS C:\neo4j-enterprise-3.5.9> notepad my.cql
PS C:\neo4j-enterprise-3.5.9> cat my.cql
match (n) return count(n);
PS C:\neo4j-enterprise-3.5.9> cat my.cql | .\bin\cypher-shell.bat -u neo4j -p secret
count(n)
171

View solution in original post

2 REPLIES 2

Create the file(s) with your cypher. I used PowerShell to show this. The | before the .\bin\cypher... is the pipe character

PS C:\neo4j-enterprise-3.5.9> notepad my.cql
PS C:\neo4j-enterprise-3.5.9> cat my.cql
match (n) return count(n);
PS C:\neo4j-enterprise-3.5.9> cat my.cql | .\bin\cypher-shell.bat -u neo4j -p secret
count(n)
171

Thanks for reply, I will try it.