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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.7.0
    • Component/s: camel-bindy
    • Labels:
      None
    • Estimated Complexity:
      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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              darioxz Dario Röthlisberger

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment