webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Using flat file getting output in CSV format with double quotes issue

webMethods Community Member

webMethods Community MemberMon September 29, 2014 04:49 AM

  • 1.  Using flat file getting output in CSV format with double quotes issue

    Posted Mon September 29, 2014 04:03 AM

    Hi,

    I have created a flat file dictionary which has a single Record Definition named (LINE) and extractor type Nth Field.
    I created a flat file schema using this dictionary and set the properties as mentioned below:
    When i run this schema with the sample output, it gives me proper result, i mean the values formed in the ffValues contain the double quote
    Expected output : “1”;;“2014-09-10”;;“Name”;“587”;“mtb”;“Anger”

    Record Parser type: Delimiter
    Record : Newline
    Field or composite : [b]; /b
    Starts at position zero (0)

    I created a document from this schema I get the document with the below structure
    recordWithNoID
    LINE
    recordWithNoID

    In my service
    I have invoked the pub.flatFile:convertToString and i am passing my document to ffValues and entered the schema in ffSchema
    The final string which is being formed doesn’t contain double quotes for every field. Please let me know what is the property which needs to be set to get the values in double quotes

    Current output : 1;;2014-09-10;;Name;587;mtb;Anger


    #Integration-Server-and-ESB
    #edi
    #webMethods


  • 2.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Mon September 29, 2014 04:49 AM


  • 3.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Mon September 29, 2014 04:53 AM

    Also share the screen shot of your FF dictionary showing the Record Definition and field definition;


    #Integration-Server-and-ESB
    #edi
    #webMethods


  • 4.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Mon September 29, 2014 05:18 AM

    Hi Mahesh,

    I have created the Field definition. Using the same fields I have created the FF Record Definition. Attached is the screen shot.

    Regards,
    Monish
    FFRecordDefinition.PNG


    #webMethods
    #Integration-Server-and-ESB
    #edi


  • 5.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Mon September 29, 2014 05:27 AM

    Monish,

    If possible can you attach your sample package and input FF (if you are authorized to) so that I can reproduce the same and check.

    I see you have field reference in your dictionary under the record definition.


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Mon September 29, 2014 11:18 AM

    Hi Mahesh,

    I have created the sample service. I have harcoded the input, the way i get in the document.(i.e without quotes). Kindly let me know if it is possible to get “” for every value wheni convert it to string. without using makeString for every mapping.

    Regards,
    Monish
    FF_doubleQuoteIssue.zip (8.38 KB)


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Mon September 29, 2014 11:35 AM

    Manish,

    Where did you set in the FF schema to have output with double quotes? or you set it as a release character?

    HTH,
    RMG


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Tue September 30, 2014 02:17 AM

    Hi Mahesh,

    I tried setting the release character with “”. But that didn’t help.


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Tue September 30, 2014 04:26 AM

    Not sure whether you can get “” calling pub.flatFile:convertToString never experienced such requirement but anyways I will check.

    Anyways you have the alternative solution for now.


    #Integration-Server-and-ESB
    #webMethods
    #edi


  • 10.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Tue September 30, 2014 09:10 AM

    I think you have to go for the alternative solution.


    #webMethods
    #edi
    #Integration-Server-and-ESB


  • 11.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Tue September 30, 2014 11:27 AM

    What alternative solution are you saying about release Char set?

    HTH,
    RMG


    #edi
    #Integration-Server-and-ESB
    #webMethods


  • 12.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Sat November 19, 2016 06:51 AM

    Hello

    Has anyone successful in finding out, if this is possible in webMethods using converttostring and with any setting in ff?

    Also, would like to know what was the alertnative solution used.

    Thanks
    Anish


    #webMethods
    #edi
    #Integration-Server-and-ESB


  • 13.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Mon November 21, 2016 11:09 AM

    Are you dealing the same/similar issue and if yes please try to elaborate on your side and tries made so far!!

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #edi


  • 14.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Tue November 22, 2016 03:08 PM

    for parsing CSV, it’s suggest to use
    apache’s csv parser
    http://commons.apache.org/proper/commons-csv/
    it’s a robust and flexible alternative to FF solution offered by WM.


    #webMethods
    #Integration-Server-and-ESB
    #edi


  • 15.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Tue November 22, 2016 03:11 PM

    for parsing CSV, I’d suggest to use
    apache’s csv parser
    http://commons.apache.org/proper/commons-csv/
    it’s a robust and flexible alternative to FF solution offered by WM.


    #edi
    #Integration-Server-and-ESB
    #webMethods


  • 16.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Wed November 23, 2016 12:10 PM

    Thanks for the suggestion note Tong!

    Happy Holidays!
    RMG


    #Integration-Server-and-ESB
    #webMethods
    #edi


  • 17.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Thu November 24, 2016 06:34 AM

    hi RMG,

    The requirement is when I do the converttoString, I expect the double quotes to be present in each columns.

    For e.g
    Input: A, B, C
    Output after convertoString: “A”,“B”,“C”

    I tried various option with the converttostring option, Tried setting up the escape character, release characters…

    As a work around, I passed the quotes as part of the data, instead of expecting converttosting to do it. The other option I want to try is to use formatservice. I am not familiar with the formatsevice, hence didn’t try it yet.

    Thanks
    Anish


    #edi
    #Integration-Server-and-ESB
    #webMethods


  • 18.  RE: Using flat file getting output in CSV format with double quotes issue

    Posted Tue November 29, 2016 12:45 PM

    Yes I don’t think converttostring will put the quotes in the output unless you set/concat it explicitly in the data itself or try with the FormatService template but it’s the same routine of having it explicitly putting the quotes and you call this FormatService in the FFSchema for each of the filed you created with in the dictionary/schema.

    HTH,
    RMG


    #Integration-Server-and-ESB
    #edi
    #webMethods