[SERVER-2357] mongoimport should ignore trailing commas in CSV files Created: 13/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: Improvement Priority: Minor - P4
Reporter: Victor Song Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-1097 mongoimport / export should adhere to... Closed
is depended on by SERVER-3648 Trailing commas are not ignored by mo... Closed
Participants:

 Description   

When there are trailing commas in each line in CSV files, mongoimport creates maps "":"\r" which is useless. See an example at http://groups.google.com/group/mongodb-user/browse_thread/thread/479d90fc0d98f23b/537929bcc24fc4ce#537929bcc24fc4ce



 Comments   
Comment by Sridhar Nanjundeswaran [ 18/Aug/11 ]

Trailing commas are not ignored. fields with empty values are created. It does not create empty fields any longer as indicated in the groups thread. Logged SERVER-3648 has been created for this.

Comment by Spencer Brody (Inactive) [ 16/Aug/11 ]

This bug was fixed while fixing SERVER-1097.

Comment by Sidney San Martín [ 15/Mar/11 ]

I agree that the current behavior is incorrect, but the CSV spec (http://tools.ietf.org/html/rfc4180) doesn't say anything about ignoring trailing commas.

Is there a use case where it'd be worth going against the spec instead of just treating it as an empty value?

Generated at Thu Feb 08 02:59:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.