Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-264

Duplicate empty header names are allowed even with `.withAllowDuplicateHeaderNames(false)`

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.8
    • 1.10.0
    • Parser
    • None

    Description

      I'm trying to parse to parse a csv like this:

       

      CSVFormat.DEFAULT
      {{ .withHeader()}}
      {{ .withAllowDuplicateHeaderNames(false)}}
      {{ .withAllowMissingColumnNames()}}
      {{ .parse(InputStreamReader(FileInputStream(fl)))}}

       

      One would expect this code to throw an error if the following csv is given as input:

       

       

      "","a",""

      "1","X","3"

      "3","Y","4"

       

      But it doesn't, and asking for `record.get("")` gives the value from the second column. The first column is ignored.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fctorial Sagar Tiwari
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4.5h
                  4.5h