When you try to import data from a file using LOAD CSV where the filename containing spaces for example you get the following error:
load csv from "file:///test copy.csv" as row return row
java.net.URISyntaxException: Illegal character in path at index 10: file:/test copy.csv
To allow for a space in the filename, simply replace the space in the LOAD CSV command with %20 (url encoding)
load csv from "file:///test%20copy.csv" as row return row
Similarly, if you have any other characters (such as #) in the filename, simply replace that charater with the appropriate ASCII url encoding (for # it happens to be %23).
An ASCII encoding reference can be found here:
- Last Modified: 2020-10-22 22:13:22 UTC by Rohan Kharwar.
- Relevant for Neo4j Versions: 3.1, 3.2.
- Relevant keywords load-csv.