Author |
Message
|
proton |
Posted: Sat Jul 23, 2022 7:31 pm Post subject: IIB V9 how to preserve a comma coming inside double qoutes |
|
|
Novice
Joined: 14 Mar 2022 Posts: 11
|
Hi,
I am working on a maintenance project and the development was done in V9 and using MRM. We have to process a CSV file (delimiter comma ,). unfortunately we are some times getting data of a particular field in double quotes and then a comma inside.
Ex: 1,2,3,"3,4",5
in message definition while parsing it is treating comma inside the quotes also as a delimiter and not parsing properly..
intended output is
filed 1: 1
field 2: 2
field 3: 3
field 4: :"3,4"
filed 5: 5
Kindly please be noted no changes can be requested to the one who is sending file.. please let me know setting on MRM to preserve the comma inside the double quotes and dont treat it as a delimiter ..
Thanks,
Proton.. |
|
Back to top |
|
 |
proton |
Posted: Sun Jul 24, 2022 5:49 pm Post subject: |
|
|
Novice
Joined: 14 Mar 2022 Posts: 11
|
Please advise.. Thank you. |
|
Back to top |
|
 |
timber |
Posted: Mon Jul 25, 2022 12:53 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
Please advise.. Thank you. |
Please be patient. You posted your question during a weekend, and you are asking for free advice for an out-of-support version of IIB.
Quote: |
please let me know setting on MRM to preserve the comma inside the double quotes and dont treat it as a delimiter .. |
Since v8, the MRM parser is not the recommended method for parsing CSV.
If you really want to continue using MRM TDS, there are posts on this forum that describe how to solve this problem (although I am struggling to find them now).
The easiest and best solution is to switch to using DFDL. The CSV wizard will produce a DFDL schema that automatically handles this. And you can test it in the IIB Toolkit (using the DFDL Test perspective), and check that it handles your input data. |
|
Back to top |
|
 |
proton |
Posted: Mon Jul 25, 2022 9:21 am Post subject: |
|
|
Novice
Joined: 14 Mar 2022 Posts: 11
|
Thank you very much Timber and much appreciate your reply. Even i thought the same after posting my second reply. I truly agree with the DFDL but seems that is not the possibility here.
I tried some work around and conditions and added some code to the existing base and got very close to the solution. I will do more tests and post here if that works.
I tried to search the forum before posting and dint found any results seems my keywords are wrong.
Again thank you very much for the advise and i truly stand with each and every word you stated. |
|
Back to top |
|
 |
timber |
Posted: Tue Jul 26, 2022 3:18 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
|
Back to top |
|
 |
proton |
Posted: Tue Jul 26, 2022 5:21 am Post subject: |
|
|
Novice
Joined: 14 Mar 2022 Posts: 11
|
Thanks Timbert. Appreciate for taking time and directing to the post, my solution is also in the similar lines but i has to do some additional mapping and properties for my desired output.
Thanks and much appreciate your reply.. the thread you pointed gave me new tips that i will use for similar situation mentioned in that thread.. |
|
Back to top |
|
 |
|