作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有一个包含以下数据的 csv 文件,想将其导入 mongodb
ID;"AdmissionID";"SeatNo";"RegistrationNo";"ResultDate";"ResultStatusId"
1;12;"2323";"23";07-05-2013;1
2;23;"35";"32";10-05-2013;5
此数据将导入到 mongodb 2.2。我正在使用以下命令:
mongoimport -d test -c exam --type csv --headerline <f:\exam.csv
使用时出现以下错误
SyntaxError: missing ; before statement (shell):1
请帮我找出错误
最佳答案
这应该很容易做到这一点。更多 HERE .
mongoimport -d mydb -c collectionName --type csv --file myfile.csv --headerline
您的问题是 <f:\exam.csv
位,它看起来没有正确转义
> --headerline
> If using “--type csv” or “--type tsv,” use the first line as field names. Otherwise, mongoimport will import the first line as a distinct
> document.
关于mongodb - 如何在mongodb中导入csv文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16417029/
我是一名优秀的程序员,十分优秀!