如何将csv文件导入neo4j NumberFormatException

时间:2013-12-15 17:48:41

标签: csv neo4j

我已按照maxdemarzi的步骤进行操作。我拿了这个example的csv数据。 但是,执行此命令时会出现此错误。

java -server -Dfile.encoding=UTF-8 -Xmx4G -jar batch-import-jar-with-dependencies.jar neo4j/data/graph.db BeerNodes.csv BeerRelationships.csv

Usage: Importer data/dir nodes.csv relationships.csv [node_index node-index-name
 fulltext|exact nodes_index.csv rel_index rel-index-name fulltext|exact rels_ind
ex.csv ....]
Using: Importer neo4j/data/graph.db BeerNodes.csv BeerRelationships.csv

Using Existing Configuration File

Importing 2351 Nodes took 0 seconds

Total import time: 2 seconds
Exception in thread "main" java.lang.NumberFormatException: For input string: "1
,10000,isa"
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Long.parseLong(Unknown Source)
        at java.lang.Long.parseLong(Unknown Source)
        at org.neo4j.batchimport.Importer.id(Importer.java:195)
        at org.neo4j.batchimport.Importer.id(Importer.java:163)
        at org.neo4j.batchimport.Importer.importRelationships(Importer.java:129)

        at org.neo4j.batchimport.Importer.doImport(Importer.java:214)
        at org.neo4j.batchimport.Importer.main(Importer.java:78)

有什么建议吗?

2 个答案:

答案 0 :(得分:1)

转换您的csv文件以使用TAB作为字段分隔符。

答案 1 :(得分:0)

要么做Stefan说的话,要么:

使用逗号作为分隔符配置导入程序,其中包含:batch_import.csv.delim=, 在您的batch.properties中。

请参阅:https://github.com/jexp/batch-import#csv-experimental