My goal is just to use Dataweave to remove the first line ('a') in the below CSV file and then convert CSV to JSON. I can get my Dataweave working online in the Dataweave Playground (https://developer.mulesoft.com/learn/dataweave/) but it will not run on an actual runtime for some reason.
Input CSV:
a
id,name
1,lee
2,natasha
Dataweave:
%dw 2.0
input payload application/csv headerLineNumber=2
output application/json
---
payload
Output JSON:
[
{
"id": "1",
"name": "lee"
},
{
"id": "2",
"name": "natasha"
}
]
Problem, when I run this on a local runtime, here is the output I get using the exact same dataweave. Curious what I could be doing wrong? Why would the exact same script work online but not on an actual runtime?
[
{
"a": "id",
"column_1": "name"
},
{
"a": "1",
"column_1": "lee"
},
{
"a": "2",
"column_1": "natasha"
}
]