Camel
  1. Camel
  2. CAMEL-5166

camel-csv - Add option to skip first line when unmarshalling

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.10.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      If the first line is CSV headers, then you want to skip this line. Currently there seems to be no easy way of configuring this on <csv> data format.
      Likewise, we should check camel-flatpack for similar option. And camel-bindy as well.

        Activity

        Hide
        Christian Müller added a comment -

        May this option should more flexible to define the number of lines which should be skipped.

        Show
        Christian Müller added a comment - May this option should more flexible to define the number of lines which should be skipped.
        Hide
        Babak Vahdat added a comment -

        According to the RFC-4180 there maybe one optional header line:

        http://tools.ietf.org/html/rfc4180

        There maybe an optional header line appearing as the first line
        of the file with the same format as normal record lines.  This
        header will contain names corresponding to the fields in the file
        and should contain the same number of fields as the records in
        the rest of the file (the presence or absence of the header line
        should be indicated via the optional "header" parameter of this
        MIME type).  For example:
        
        field_name,field_name,field_name CRLF
        aaa,bbb,ccc CRLF
        zzz,yyy,xxx CRLF
        

        So that IMHO providing "number of lines" semantics would be an unnecessary overkill.

        Show
        Babak Vahdat added a comment - According to the RFC-4180 there maybe one optional header line: http://tools.ietf.org/html/rfc4180 There maybe an optional header line appearing as the first line of the file with the same format as normal record lines. This header will contain names corresponding to the fields in the file and should contain the same number of fields as the records in the rest of the file (the presence or absence of the header line should be indicated via the optional "header" parameter of this MIME type). For example: field_name,field_name,field_name CRLF aaa,bbb,ccc CRLF zzz,yyy,xxx CRLF So that IMHO providing "number of lines" semantics would be an unnecessary overkill.
        Hide
        Babak Vahdat added a comment -

        The newly provided option is called skipFirstLine which is provided both on Java as well as XML DSL.

        Show
        Babak Vahdat added a comment - The newly provided option is called skipFirstLine which is provided both on Java as well as XML DSL.
        Hide
        Babak Vahdat added a comment - - edited

        camel-bindy already provides an option with the same name (skipFirstLine): http://camel.apache.org/bindy.html

        And the camel-flatpack's provided option is called ignoreFirstRecord: http://camel.apache.org/flatpack.html

        So that by those two formats we're already fine in place.

        Show
        Babak Vahdat added a comment - - edited camel-bindy already provides an option with the same name ( skipFirstLine ): http://camel.apache.org/bindy.html And the camel-flatpack's provided option is called ignoreFirstRecord : http://camel.apache.org/flatpack.html So that by those two formats we're already fine in place.

          People

          • Assignee:
            Babak Vahdat
            Reporter:
            Claus Ibsen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development