Hi everyone,
I want to import files from a different location than the import folder in neo4j_HOME. I figured out that i need to comment out the directory in the config part, but i'm still stuck in the neo4j_HOME folder. I'd love to set it that i can start in C: ... but don't really know how to archieve it. Any help appreciated <3
i commented this out, but couldn't really find any specific in the manual
Tim - thanks for your question. I have a short answer and an optional long answer.
SHORT ANSWER:
To import files from a different location than the default import folder in Neo4j, you can specify the file path of the folder in your Cypher script using the LOAD CSV command. For example:
LOAD CSV FROM 'file:///C:/your_folder/your_file.csv' AS row
This will load data from the specified file in the "C:\your_folder" directory. Note that you should replace "your_file.csv" with the name of your actual file.
LONG ANSWER
To make it easier to load files from a specific folder, you can also create a symbolic link in the Neo4j import folder that points to the desired folder location. Here's how you can create a symbolic link in Windows:
- Open the Command Prompt as an administrator.
- Navigate to the Neo4j import folder by entering the following command:
cd path\to\neo4j\import
- Create a symbolic link using the
mklink
command. For example: mklink /D my_folder C:\your_folder
- You should now see a new folder called "my_folder" in the Neo4j import folder that points to the "C:\your_folder" directory.
- You can now use the following command to load files from the "C:\your_folder" directory:
LOAD CSV FROM 'file:///my_folder/your_file.csv' AS row
This should allow you to load data from a specific folder location in your Cypher scripts. The advantage of this method is that if you have files living in a central or alternate folder you have access directly from your Neo_4j import\my_folder. Either way should accomplish the task.
Let us know how it goes.
Hi Alison,
actually the long answer works perfectly for me.
Thanks a lot for your detailed description :)
1 Like