Do you use the same file to process on linux?
As you know the file in windows, the line is separate with "\r\n", in linux it 
ends with "\n"[1].

Can you try to process the file with dos2unix before using camel to process it? 


[1]http://www.cs.toronto.edu/~krueger/csc209h/tut/line-endings.html
-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Monday, October 29, 2012 at 4:53 AM, Denis S wrote:

> Hi All,
> 
> I have the following Camel route:
> 
> <route id="processFile">
> <from uri="direct:csv"/>
> 
> <onException>
> <exception>java.lang.Exception</exception>
> <handled>
> <constant>true</constant>
> </handled>
> <bean ref="myFileProcessor"
> method="processError" />
> </onException>
> 
> <split streaming="true">
> <tokenize token="\n"/>
> <unmarshal>
> <csv /> 
> </unmarshal>
> <process ref="myFileProcessor"/>
> </split>
> </route>
> 
> The files I'm processing aree huge, so I use streaming. I split files line
> by line and then unmarshal them with csv parser. Everything works fine on
> windows. But on linux it does not work for some reason. In the processError
> method I receive lines which were not split correctly and can't be parsed
> correcly by CSVParser as a result: 
> 
> "5701","FX S
> 
> the real line is:
> 
> "5701","FX SETT","286421","schmwe - Prev E10m/1yr increased to E150m/3mths,
> E10m/1yr","EUR","3","S"
> 
> Looks like the file wasn't split by lines properly. Please advise which
> token should I use to split files properly on linux platform?
> 
> Thanks, Denis.
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Trouble-with-split-tokenize-on-linux-tp5721677.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to