Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15920

Cannot parse CSV if the last (not required) field is empty when using a tab separator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.7.0
    • camel-bindy
    • None
    • Unknown

    Description

      Parsing a CSV file fails if the following conditions are met:

      • tab separator
      • last field is empty
      • not all fields are required

       

      Example 1

      CSV: "VOA\t12 abc street\tMelbourne\tVIC\t3000\tAustralia\t\t"
      

      The last two fields are empty and the CSV cannot be parsed.

      Example 2

      CSV: "VOA\t12 abc street\tMelbourne\tVIC\t3000\tAustralia\t\tNot Empty"
      

      The last field is not empty and the CSV can be parsed.

       Example 3

      CSV: "VOA,12 abc street,Melbourne,VIC,3000,Australia,,"
      

      If the comma separator is used and the last field is empty, the CSV can be parsed.

      I've just created a test case on current master to demonstrate the bug:

      Camel-Bindy: csv cannot be parsed if (not required) last field is empty and a tab separator is used by darioxz - Pull Request #1 - darioxz/camel (github.com)

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              darioxz Dario Röthlisberger
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: