我将CSV格式的文件保存为CouchDB中的附件,但是当我检索它们时,缺少新行。我应该采取哪些不同的方式来保留换行符?
% cat -vet foo.csv
line1-field1, line1-field2, line1-field3$
line2-field1, line2-field2, line2-field3$
% curl -X PUT -H "Content-type: text/csv" -d @foo.csv $SERVER/testdb/testdoc/foo
{"ok":true,"id":"testdoc","rev":"1-fe07e847a7934a14055890ff3d8f5603"}
% curl -X GET $SERVER/testdb/testdoc/foo |cat -vet
line1-field1, line1-field2, line1-field3line2-field1, line2-field2, line2-field3%
答案 0 :(得分:1)
由于某种原因,卷曲似乎正在剥离新行。我设法通过强制二进制来避免它:
curl -X PUT -H "Content-type: text/csv" --data-binary @foo.csv $SERVER/testdb/testdoc/foo