LOAD CSV FROM 'file:///sentence.csv' AS line
CREATE (:SENTENCE { name: line})
The nodes created will make name-arrays in rows with commas
{
"identity": 1,
"labels": [
"SENTENCE"
],
"properties": {
"name": [
"this is the sentence",
" which makes this weird problem",
" separating by the commas"
]
}
}
I want to just all rows as complete values, whatever symbols are in the CSV. Every line should be a node name
sample of csv:
Hvis du fik tilbudt 100.000 kr, men din værste fjende ville få 500.000 kr, ville du så stadigvæk tage imod tilbuddet?
Hvilke råd synes så indlysende korrekte og ligetil at efterfølge, men bliver altid ignoreret
Hvornår blev du første gang opmærksom på, hvad det vil sige at være dansk?
Fortæl om et sted i Danmark, der betyder noget særligt for dig. Hvor i Danmark føler du dig hjemme? Hvad savner du ved Danmark, når du har været væk?
You can add quotation marks to the lines in the CSV to tell it's full strings – otherwise the CSV interpreter will expect that it's comma separated values :)
In case you have quotation marks in any of the lines, you will need to escape them as per LOAD CSV - Cypher Manual
The "sample of csv" you provided is NOT a csv. That's why you're having trouble.
CSV means "Comma Separated Values".
What you have is a list of strings separated by newlines. There are ways to address this, as @Thomas_Silkjaer pointed out (wb Thomas! ). IMO, I'd just fix the source file, and make sure it was a CSV, or turn it into json, and use apoc.load.json.
Your file as a CSV:
sentence
"Hvis du fik tilbudt 100.000 kr, men din værste fjende ville få 500.000 kr, ville du så stadigvæk tage imod tilbuddet?"
"Hvilke råd synes så indlysende korrekte og ligetil at efterfølge, men bliver altid ignoreret"
"Hvornår blev du første gang opmærksom på, hvad det vil sige at være dansk?"
"Fortæl om et sted i Danmark, der betyder noget særligt for dig. Hvor i Danmark føler du dig hjemme? Hvad savner du ved Danmark, når du har været væk?"
Your file as JSON:
[
"Hvis du fik tilbudt 100.000 kr, men din værste fjende ville få 500.000 kr, ville du så stadigvæk tage
imod tilbuddet?",
"Hvilke råd synes så indlysende korrekte og ligetil at efterfølge, men bliver altid ignoreret",
"Hvornår blev du første gang opmærksom på, hvad det vil sige at være dansk?",
"Fortæl om et sted i Danmark, der betyder noget særligt for dig. Hvor i Danmark føler du dig hjemme? Hvad savner du ved Danmark, når du har været væk?"
]
I have an Excel-spreadsheet with sentences with both comma (,) and quotation marks (").
When choosing save as CSV in Excel, there are different types of CSV, some of them not even seperated with commas, but rather with semicolons or tabulator.
The spreadsheet i am exporting as CSV does only have one column and therefore no fieldterminator
My solution was neither to put quotation marks around the lines, nor to escape the commas or quotation marks. instead in just filled the second column with the same word: "STINKYWINKY" and exported to CSV