0

I am importing a csv from command prompt using mongoimport statement.

Some of the description fields in my csv contains blank lines in their value, which is breaking when I am importing the csv into mongoDB. (Please note - When I am viewing the same csv in excel, it is coming out to be perfect)

There is a message on command prompt when I run mongoimport command, as follows:

"CSV file ends while inside quoted field".

It did not solve my problem either.

Here is an example that defines my CSV

Input CSV format

Column1,Column2,Column3,Column4

Values: Val1,Val2,Val3

Val1,"abcdsc \n \n \n some text",Val3

Please advise how can I proceed further

Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56
Shweta
  • 25
  • 8

1 Answers1

1

try mongoimport manual

--ignoreBlanks
In csv and tsv exports, ignore empty fields. If not specified, mongoimport creates fields without values in imported documents.
Ernestas Poskus
  • 125
  • 1
  • 5
  • Unfortunately, the trick is not working in my case. The result is still the same, I just noticed that there is a message on command prompt when I run this command. "CSV file ends while inside quoted field". Please advise how can i proceed further – Shweta Sep 09 '14 at 10:12
  • Check this out: http://stackoverflow.com/questions/24817654/mongoimport-csv-file-ends-while-inside-quoted-field-error – vmr Sep 09 '14 at 13:45