THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
CsvDataFormat csv = new CsvDataFormat();
CSVStrategy strategy = CSVStrategy.DEFAULT_STRATEGY;
strategy.setDelimiter('|');
csv.setStrategy(strategy);
from("direct:start")
.unmarshal(csv)
.to("bean:myCsvHandler?method=doHandleCsv");
|
Code Block |
---|
CsvDataFormat csv = new CsvDataFormat(); csv.setDelimiter("|"); from("direct:start") .unmarshal(csv) .to("bean:myCsvHandler?method=doHandleCsv"); |
Code Block |
---|
CsvDataFormat csv = new CsvDataFormat(); CSVConfig csvConfig = new CSVConfig(); csvConfig.setDelimiter(";"); csv.setConfig(csvConfig); from("direct:start") .unmarshal(csv) .to("bean:myCsvHandler?method=doHandleCsv"); |
Info | ||
---|---|---|
| ||
It looks like that
doesn't work. You have to set the delimiter as a String! |
Dependencies
To use CSV in your Camel routes you need to add a dependency on camel-csv, which implements this data format.
...