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

String split with an escape pattern

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • Review, 1.x
    • Parser

    Description

      Often times there are strings which are delimited, but certain patterns can escape the delimiter. For example, quotes are used in CSV to escape a comma delimiter. I have written a couple methods for StringUtils that split strings while considering the possibility of an escape pattern. For example, when given "a,\"b,c\",c", it will produce

      {"a","\"b,c\"","c"}

      . In my code, the delimiter can be a string, and it can be escaped by any regular expression pattern. Unit tests are already written and passing.

      I plan to attach the patch for this once the ticket is created. I just need a committer to review the patch, approve, and commit it for me.

      Attachments

        1. StringUtilsSplitEscapingly.patch
          9 kB
          Michael Knapp

        Activity

          People

            Unassigned Unassigned
            msknapp Michael Knapp
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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