Hi All,
I am working in one of the requirement where I have to convert json to csv.
I am getting below input for one of the field.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
"Hi ,\r\n\r\n\r\nThis is a test mail for esb integration testing from ESB, Please ignore.\r\n\r\n\r\nThanks\r\n\r\nAjay Tiwari\r\n\r\n72938471209348\r\n\r\n
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
I want output like below in one of the csv file column.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Hi ,
This is a test mail for esb integration testing from ESB, Please ignore.
Thanks
Ajay Tiwari
72938471209348
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
I have used below mapping in dataweave
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
body_content: value.body.content as :string replace /([\r\n,\-\,\/,\\\\])/ with "",
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
and getting below output
Hi This is a test meeting for Integration purpose .Please join test meeting.ThanksAjay Tiwari
Can any one help me to address what wrong i am doing?How can i get desired output.
Thanks
Ajay Tiwari
You're replacing all the newlines (escaped with backslash n) as empty string. So why not leave them in there if you want them to be in the output?