I'm trying to import à CSV via Neo4JShell on Neo4J 3.0.4.
This script worked on an older version of Neo4J.
Here's my script :
USING PERIODIC COMMIT 5000
LOAD CSV WITH HEADERS FROM
"file:///my_file.csv"
AS line FIELDTERMINATOR ';'
WITH coalesce(line.VAR1,"") as var1
MERGE (i:myObject {var1: var1})
But I get this error :
WARNING: Invalid input 'S': expected 'n/N' (line 9, column 2 (offset: 247))
"USING PERIODIC COMMIT 5000"
Any idea ?
I install the zip version, one powershell to run "invoke-neo4j console", and an other powershell to run de "invoke-neo4jshell -file "my_script.cypher"
Thanks.
Related
I am using the following command to export the data
\copy (select * From table_name) To 'my_path' With CSV DELIMITER ',' HEADER;
But I get error syntax error at or near "\".
If I use
copy (select * From table_name) To 'my_path' With CSV DELIMITER ',' HEADER;
I get the error COPY TO instructs the PostgreSQL server process to write a file. You may want a client-side facility such as psql's \copy.
I really do not know which command I should run. Thanks in advance for your help:))
I hope I am not out of OT I have a problem with powershell v2.0 with win 7 I am writing a dos batch file whose task, among other things, is to download a file. To do this I am using powershell 2.0 by win 7. I don't know this language and I can't go on anymore.
powershell.exe -NoExit -Command "& {(New-Object System.Net.WebClient).DownloadFile("https://downloads.html/example.exe","C:\tmp\example.exe")}"
the error he gives me is the following
')' missing in the method call. In row: 1 car: 52
& {((New-Object System.Net.WebClient) .DownloadFile (<<<< https://downloads.ar
duino.cc/arduino-1.8.13-windows.exe,C:\tmp\arduino-1.8.12-windows.exe))}
CategoryInfo: ParserError: (CloseParenToken: TokenId) [], Paren
tContainsErrorRecordException
FullyQualifiedErrorId: MissingEndParenthesisInMethodCall
thanks
The syntax is
(New-Object System.Net.WebClient).DownloadFile($url, $output)
I didn't run your code but it looks like you're missing a parentheses before ".download".
I am trying to import a CSV file into the neo4j database, I adopted the sample online but I still failed.
I executed the following command under the 'import' directory:
../bin/neo4j-admin import --into retail.db --id-type string --nodes:Customer customers.csv --nodes products.csv --nodes orders_header.csv --relationships:CONTAINS order_details.csv --relationships:ORDERED customer_orders_headers.csv
Expectedly,the windows powershell should have results like:
IMPORT DONE IN 5s 212ms
Imported:
6 nodes
7 relationships
12 properties
However,my actual result is
expected '--nodes 'to have at least 1 valid item,but had 0[]
and gave me some usage guidance of neo4j-admin import. I cannot tell what the problem was because my command seemed correct.
I found this neo4j data exporting tool (https://github.com/jexp/neo4j-shell-tools#cypher-import) and it worked perfectly on my mac OS computer. I followed the same step to export data from a ubuntu server and the following error message was generated without further explanations.
Has anyone used this tool on ubuntu and any idea what the error message may indicate? Also, is there another way to export large (~100M rows) neo4j data into a csv file?
neo4j-sh (?)$ import-cypher -d"," -o test.csv match (p:Product)-[s:SIMILAR_TO]-(q:Product) return p.Id,q.Id limit 10
Query: match (p:Product)-[s:SIMILAR_TO]-(q:Product) return p.Id,q.Id limit 10 infile (none) delim ',' quoted false outfile test.csv batch-size 1000
Error occurred in server thread; nested exception is:
java.lang.NoSuchMethodError: org.neo4j.graphdb.GraphDatabaseService.execute(Ljava/lang/String;)Lorg/neo4j/graphdb/Result;
I just added a new way of exporting data as cypher statements.
https://github.com/jexp/neo4j-shell-tools#cypher-export
(Note this is for Neo4j 2.2.5)
But for 100M rows I think import-cypher -o is still a good approach.
Otherwise check out: http://neo4j.com/blog/export-csv-from-neo4j-curl-cypher-jq/
I downloaded z3 source codes from the master branch and tried to build it, which resulted in the following error:
c:\Program Files\z3>python --version
Python 3.3.2
c:\Program Files\z3>python scripts\mk_make.py
Traceback (most recent call last):
File "scripts\mk_make.py", line 9, in <module>
from mk_util import *
File "c:\Program Files\z3\scripts\mk_util.py", line 81
print "dos2unix '%s'" % fname
^
SyntaxError: invalid syntax
Am I doing something wrong?
The master branch only works with Python 2.7.x.
The unstable (working-in-progress) branch should work with Python 3.x.
Here are instructions to compile the working-in-progress branch.