0
votes

I want to append --EOF at the end of file in CSV after transforming JSON to CSV in Mule Data Weave 2.0

Input:

{ "serialNumber": "ABCD", "asset": "EFGH" }

Output:

ABCD|EFGH

--EOF

1

1 Answers

1
votes

Use the write() function to write the output as a string so you can concatenate it to the EOF string that you want.

Example:

%dw 2.0
output text/plain
---
write(payload, "application/csv", {"header":false, "separator" : "|"}) ++ "\n--EOF"