Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2379

mongoimport + csv with commas in values: extraneous data

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.2
    • Affects Version/s: 1.6.5
    • Component/s: Tools
    • Labels:
      None
    • Environment:
      10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386
    • ALL

      $ cat blah.csv
      name,location
      "Bob","Somewhere, Out There"
      "Chris","Right here"
      $ mongoimport -h localhost -d testing -c testing --headerline -type csv --file blah.csv
      connected to: localhost
      imported 3 objects
      $ mongo testing
      MongoDB shell version: 1.6.5
      connecting to: testing
      > db.testing.find()

      { "_id" : ObjectId("4d372b87a0a15c6c1ae2f8ea"), "name" : "Bob", "location" : "Somewhere, Out There" } { "_id" : ObjectId("4d372b87a0a15c6c1ae2f8eb"), "name" : "Chris", "location" : "Right here", "field2" : " There\"" }

      note garbage "field2" field/value in second record, coming somehow from value with a comma in first record

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            cgill Chris Gill
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: