[SERVER-2379] mongoimport + csv with commas in values: extraneous data Created: 19/Jan/11 Updated: 12/Jul/16 Resolved: 16/Aug/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Tools |
| Affects Version/s: | 1.6.5 |
| Fix Version/s: | 1.9.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Chris Gill | Assignee: | Spencer Brody (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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 |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
$ cat blah.csv note garbage "field2" field/value in second record, coming somehow from value with a comma in first record |
| Comments |
| Comment by Spencer Brody (Inactive) [ 16/Aug/11 ] |
|
This code was majorly reworked in fixing |
| Comment by Sidney San Martín [ 05/Jul/11 ] |
|
Pull request: https://github.com/mongodb/mongo/pull/30 |
| Comment by Lance Lovette [ 21/Feb/11 ] |
|
I just tested the nightly build (mongodb-linux-i686-2011-02-21) and the issue persists. |
| Comment by Lance Lovette [ 21/Feb/11 ] |
|
I'm on CentOS 5.5 with mongod 1.6.5 (from RPM) and have this same issue. Text from longer records is carried over into a bogus field in future records. $ cat blah.csv $ mongoimport --db blah -c blah --file blah.csv --fields a,b --type csv --drop -vvv $ mongo blah The import is correct if I remove the quotes altogether, or replace the comma with a TAB (although that includes the quotes in the field value). |
| Comment by Guanqun Lu [ 27/Jan/11 ] |
|
I tried on my mac osx with latest source, no such problem found... |
| Comment by Chris Gill [ 19/Jan/11 ] |
|
sorry that name is not very specific, i can't seem to change it. should be more like "mongoimport for csv with commas in values results in extraneous data during import" |