Results 1 to 3 of 3

Thread: How to Ignore Double Quotes in incoming csv file

  1. #1
    Join Date
    Jan 2011
    Posts
    12

    Default How to Ignore Double Quotes in incoming csv file

    has anyone ran into this issue; We have input files the we ETL ,using Spring Batch 2.1.8, that have double quotes that surround certain values in the input stream. These quotes must be maintained for further downstream processing.

    Is there a way to tell the provided LineMapper to ignore these quotes when tokenizing the unput record or is a custom implementaion required ?
    ie.

    incoming record-> 190025^Port^2374^Conference ""Stat""^
    outgoing -> 190025^Port^2374^Conference ""Stat""^

    Currently the tolenizer produces :
    outgoing -> 190025^Port^2374^Conference "Stat"^

    thanks

  2. #2
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    366

    Default

    By default the DelimitedLineTokenizer assumes " is a quote character. In this scenario, I think if you just change it to something else (say $) you should be fine.
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

  3. #3
    Join Date
    Jan 2011
    Posts
    12

    Default

    ok Great. thanks for the reply. Will give it a go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •