How to load CSV file with cypher in java?

前端 未结 2 1121
暗喜
暗喜 2021-01-23 04:55

I am new to cypher. I want to load a csv using cypher in java. I googled and found the following piece

LOAD CSV WITH HEADERS FROM \"http://neo4j.com/docs/2.3.         


        
相关标签:
2条回答
  • 2021-01-23 05:22

    To correct the Java syntax error, you need to escape double quotes in the middle of the string; otherwise it looks like your string literal finishes at the quote around the path:

    "LOAD CSV WITH HEADERS FROM \"C:/..../Mock_data.csv\" AS csvLine "
    
    0 讨论(0)
  • 2021-01-23 05:40

    Finally this Worked for me!!

    ExecutionResult result = engine.execute("LOAD CSV WITH HEADERS FROM 'file:///Users/xxxxx/Documents/Txx.csv' AS csvLine ")
    
    0 讨论(0)
提交回复
热议问题