I am using smooks mediator to convert csv file to json using VFS. We have an option to skip header row while using the CSV connector/module. How do I skip the first row of headers while processing the file in WSO2 Integration studio using smooks?
Asked
Active
Viewed 235 times
1 Answers
2
In your Smooks
configurtion add the following option.
skiplines="1"
Full Smooks Config
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.5.xsd">
<csv:reader fields="name,age,address" separator="," quote="'" skipLines="1" />
</smooks-resource-list>

ycr
- 12,828
- 2
- 25
- 45
-
I am using http://www.milyn.org/xsd/smooks-1.0.xsd xsd for reading the csv file and using 1 to skip the header. But it isn't affecting the output. – Ruby Jul 18 '22 at 07:20
-
Is any extra xsd required here? – Ruby Jul 18 '22 at 10:00
-
1@Ruby `skipLines` was introduced in Smooks 1.4 hence you need to use the `csv:reader` to use this option. I updated my answer please have a look. – ycr Jul 18 '22 at 13:52