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

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

What is your input?

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

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

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.

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)

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

Hi Mahesh,

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

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.

I think you have to go for the alternative solution.

What alternative solution are you saying about release Char set?

HTH,
RMG

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

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

HTH,
RMG

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.

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.

Thanks for the suggestion note Tong!

Happy Holidays!
RMG

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

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