Hi Okay so the include tokens only apply when you use a tokenizer as pairs. I am adding some check to Camel so it will fail if you try some not supported combination of the options.
You may want to use a custom splitter that can include the data you need. Or try some regexp that may work. For what its worth Camel uses java.util.Scanner when you use that regexp so if you can get it working with java.util.Scanner then it should be possible with Camel too - or we can add some code to make it possible. I could not find an easy way to tell the scanner to return the matching part. On Fri, Jul 10, 2015 at 8:26 AM, Claus Ibsen <[email protected]> wrote: > Hi > > I wonder if its because you use regexp and then include tokens is not > supported. I guess it may require special added logic to support this. > Maybe something with a group in the regexp to have it return the ENT > part as well. > > On Wed, Jul 8, 2015 at 2:55 PM, Vincent Monnin <[email protected]> > wrote: >> Hi, >> I need to split a file that contains multiple message with multiple lines >> like this: >> ENT abcd >> G00 efgh >> G01 ijkl >> G02 mnop >> ENT 1234 >> G00 5678 >> G01 1245 >> G02 1234 >> >> In this cas I need to retreive two files like that: >> File 1: >> ENT abcd' >> G00 efgh' >> G01 ijkl' >> G02 mnop' >> >> File 2: >> ENT 1234' >> G00 5678' >> G01 1245' >> G02 1234' >> >> >> I'm using DSL and wrote this context: >> >> <camelContext trace="false" id="EDI_process" >> xmlns="http://camel.apache.org/schema/spring"> >> <route id="EDI_splitter"> >> <from uri="file://C:/test/in"/> >> <split> >> <tokenize token="ENT[^']*'" regex="true" xml="false" >> includeTokens="true"></tokenize> >> <bean method="setUUIDasFileName" beanType="com.zeiss.CZVuuid"/> >> <to uri="file://C:/test/out"/> >> </split> >> </route> >> </camelContext> >> >> I cannot find a way to keep the token "ENT..." in out files .... my result >> is : >> G00 5678' >> G01 1245' >> G02 1234' >> Note that I can have G01 or G02 multiple times. >> >> I checked in forums and don't have a clue .... >> Can you help me ? >> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/Camel-Split-How-to-keep-token-when-splitting-a-multilines-files-tp5768991.html >> Sent from the Camel - Users mailing list archive at Nabble.com. > > > > -- > Claus Ibsen > ----------------- > Red Hat, Inc. > Email: [email protected] > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen > hawtio: http://hawt.io/ > fabric8: http://fabric8.io/ -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
