Reputation: 5739
I'm trying to parse a log file that has csv separated recs. All lines are to be separated to 8 fields. In some lines the last field, Field8 ,has extra commas which has to be ignored (should not be separated). Problem line lines are like below(note Field8):
Test, Field2,5731960,Field4,,4,32,Field8 MyOp ( abc,def )
I can't ask the log format to be changed. Is there a way in bindy to say from pos 8 to pos 100, put it in pos 8? I prefer spring dsl. I want to avoid custom parser if one exist already.
@CsvRecord(separator = ",")
public class SysActivity{
....
@DataField(pos = 8, required = true) // is there a way I can mention pos8 till end of line
protected String logMessage;
}
Using camel 10.0
Upvotes: 1
Views: 328
Reputation: 55750
No this is not possible. But I think its maybe a valid use-case that I think a few others in the past has asked about.
I have logged a ticket to have this improved in the future https://issues.apache.org/jira/browse/CAMEL-6381
Upvotes: 1