I have two questions.
- The first question: i use camel sql and camel csv to export database in csv.
I would like to display column names however the options of camel csv doesn't work for me while i am on camel 2.16.5 version.
ex) <csv delimiter=";" skipHeaderRecord="false" /> or <csv delimiter=";" headerDisabled="false" />
or
<csv >
<header>orderId</header>
<header>amount</header>
</csv>
All these test didn't work....
Could you please help me to solve this problem how can i make it work ?
- The seconde question : As camel csv options don't work i wanted to debug on CsvDataFormat.class from camel-csv-2.16.5.jar
But i got
'Source not found The JAR file C:\Utilisateurs\.m2\repository\org\apache\camel\camel-csv-2.16.5.jar has no source attachment'
.
I attached the source manually by clicking 'Attach source' but i still can not see the proper source class. I tried every solution already mentioned in web but not working.
Do you have any advice ?
Thanks in advance
So CSV dataformat will take your entire file and return it as a Map. You can then use the column names as keys into the map.
Let me demonstrate. I have a small csv file called customerlist.csv which looks like this:
The following will read the csv file turn it into a map and then split it line by line and you can reference the columns directly and read their values.
The output would be: