Reputation: 69
I am facing issue while pulling header value CSV with a "," comma value separation. Input:
sku,Description,data
1223,"Test Description,hello",
456,"Test",
Output
sku,Description,data
I tried with,(Converting to String)
keys = payload.split('\n')[0]
but due to large size it hitting the performance. Is there a way to get first line of csv without splitting with expression component or dataweave . Initially i got org.mule.transport.file.ReceiverFileInputStream object which i converted to string.
Upvotes: 0
Views: 873
Reputation: 4303
Try this..
%dw 2.0
output application/java
---
payload[0] pluck $$ joinBy ","
This should do the trick for you.
Upvotes: 3