Cypher Load CSV fail - there's a field starting with a quote and whereas it ends

I'm using AuraDB free tier.

Trying to import the following csv file with Cypher:

messagetime,correlatioId,messageIntent,messageType,originatingEndpoint,processingEndpoint,timestamp
a,b,c,d,e,f,g

Cypher command:

LOAD CSV WITH HEADERS FROM 'https://www.dropbox.com/s/i5enrzq1imhknab/sendCommandsMini.csv?dl=0' AS relRecords FIELDTERMINATOR ','

RETURN linenumber() AS number, relRecords

Result:

At Dropbox - sendCommandsMini.csv - Simplify your life @ position 8022 - there's a field starting with a quote and whereas it ends that quote there seems to be characters in that field after that ending quote. That isn't supported. This is what I read: 'number"!'

Tried hosting with github and drive, same problem

At sendCommandsMini.csv - Google Drive @ position 18698 - there's a field starting with a quote and whereas it ends that quote there seems to be characters in that field after that ending quote. That isn't supported. This is what I read: 'error")'

Please help,

When the URL is requested, the response should be the CSV as a raw file.

For the Google Drive URL, you can enforce raw download for the file by requesting the URL in the below format:
'https://drive.google.com/uc?id=<google_file_id>&confirm=t'

So your Cypher would be:

LOAD CSV WITH HEADERS FROM "https://drive.google.com/uc?id=1OkZBSQADIB-912mPyb49FTuPhnkvrV6g&confirm=t" AS relRecords FIELDTERMINATOR ','
RETURN linenumber() AS number, relRecords

Thanks so much, I used your recommendation and it worked.
PS. For those of you that have the same issue, please also make sure to give permission to anyone with the link to view the file.

1 Like

The correct syntax using Dropbox is using the "dl=1" flag. This indicates to download the file as raw.

LOAD CSV WITH HEADERS FROM 'https://www.dropbox.com/s/i5enrzq1imhknab/sendCommandsMini.csv?dl=1' AS relRecords FIELDTERMINATOR ','
RETURN linenumber() AS number, relRecords