Yes here is an example:
*The file looks like:*
some_string,some_other_string,other_one,121657.56
*the java class that maps the csv file:*
@CsvRecord(separator = ",", skipFirstLine = true)
public class MyClass {
@DataField(pos = 1)
private String str1;
@DataField(pos = 2)
private String str2;
@DataField(pos = 3)
private String str3;
@DataField(pos = 4, precision = 2)
private BigDecimal amount;
/*getters and setters*/
}
*And the spring route is like:*
<route id="myRoute">
<from
uri="file:///Inbox?noop=true&fileName=someCSV&consumer.delay=10000"
/>
<log message="Begin myRoute"/>
<unmarshal ref="bindyDataformat" >
<bindy type="Csv" classType="my.package.MyClass" />
</unmarshal>
...
</route>
Thanks!
--
View this message in context:
http://camel.465427.n5.nabble.com/CSV-bindy-tp5751292p5751323.html
Sent from the Camel - Users mailing list archive at Nabble.com.