1
votes

I am running neo-4j 1.8.2 on a remote unix box. I am using this jar (https://github.com/jexp/batch-import/downloads).

nodes.csv is same as given in example:

name    age works_on
Michael 37  neo4j
Selina  14
Rana    6
Selma   4

rels.csv is like this:

   start    end type    since   counter:int
1   2   FATHER_OF   1998-07-10  1
1   3   FATHER_OF   2007-09-15  2
1   4   FATHER_OF   2008-05-03  3
3   4   SISTER_OF   2008-05-03  5
2   3   SISTER_OF   2007-09-15  7

But i am getting this exception :

Using Existing Configuration File

Total import time: 0 seconds
Exception in thread "main" java.util.NoSuchElementException
        at java.util.StringTokenizer.nextToken(StringTokenizer.java:332)
        at org.neo4j.batchimport.Importer$Data.split(Importer.java:156)
        at org.neo4j.batchimport.Importer$Data.update(Importer.java:167)
        at org.neo4j.batchimport.Importer.importNodes(Importer.java:226)
        at org.neo4j.batchimport.Importer.main(Importer.java:83)

I am new to neo4j, was checking if this importer can save some coding effort. It would be great if someone can point to the probable mistake. Thanks for help!

--Edit:-- My nodes.csv

name    dob city    state   s_id    balance desc    mgr_primary mgr_secondary mgr_tertiary  mgr_name    mgr_status
John Von    8/11/1928   Denver  CO  1114-010    7.5 RA  0023-0990   0100-0110   Doozman Keith   Active

my rels.csv

start   end type    since   status  f_type  f_num
2   1   address_of              
1   3   has_account 5   Active      
4   3   f_of            Primary 0111-0230
1
Can you provide your nodes.csv and rels.csv, or are the one's above the exact ones you are using? - Nicholas
Intitially i tried with my nodes.csv and rels.csv, I was getting this error. Then i narrowed down the exact example author has quoted, its giving me same error. - dipeshtech
Have you tried pulling down the github page and compiling yourself? I look at the code he has on the page and I can't find that particular line, making me think that the JAR is out of date. - Nicholas
Yes, the jar was out of date. Now, am able to use it fine. Unavailability of maven, restricted me to build it myself. Thanks Nicholas for help. - dipeshtech

1 Answers

0
votes

Hi I had some issues in the past with the batch import script.

The formating of your file must be very rigorous, which means :

  • no extra spaces where not expected, like the ones I see in the first line of your rels.csv before "start"

  • no multiple spaces in place of the tab. If your files are exactly like what you've copied here, you have 4 spaces instead of on tab, and this is not going to work, as the script uses a tokenizer looking for tabs !!!

I had this issue because I always convert tabs to 4 spaces, and once I understood that, I stopped doing it for my csv !