为什么neo4j不添加一个新的行与n字符来自csv的数据?



我有一些数据来自csv,其中有n字符,我希望neo4j在将该字符串分配给节点中的某些属性时添加新行。显然它不起作用。我可以看到n字符,因为它被添加到字符串中。

如何让它工作?提前感谢。

下面是CSV中的一个这样的字符串示例:

Combo 4 4 4 5 nnSpare Fiber Inventory. nMultimode Individual fibers from 9927/9928 to FDB.nNo available spares from either BTS to FDB - New conduits would be requirednnFrom FDB to tower top. 9 of 9 Spares available on 2.5 riser cables.

我的加载命令:

USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS 
FROM 'file:///abc.csv' AS line
WITH line WHERE line.parent <> "" AND line.type = 'LSD' AND line.parent_type = 'XYZ'

这是我用换行符替换出现的n的hack。字符是一个转义字符,因此它将用第4行中的新行替换n。不要删除第5行并与第4行合并。

LOAD CSV WITH HEADERS 
FROM 'file:///abc.csv' AS line
WITH line WHERE line.parent <> ""
WITH replace(line.parent,'\n',"   
") as parent
MERGE (p:Parent {parent: parent}) 

结果:

{
"identity": 16,
"labels": [
"Parent"
],
"properties": {
"parent": "Combo 4 4 4 5    

Spare Fiber Inventory.    
Multimode Individual fibers from 9927/9928 to FDB.   
No available spares from either BTS to FDB - New conduits would be required   

From FDB to tower top. 9 of 9 Spares available on 2.5 riser cables."
}
}