0

I have a big file and I use splitter to process it. I use .split().tokenize("\n", 5).streaming(); to group lines.

How can I send every group to different endpoint?

Soma
  • 861
  • 2
  • 17
  • 32
lioshaq
  • 21
  • 5
  • Could you please add a little more description about the problem you have? – abarisone Jun 03 '15 at 12:59
  • i need to split a file to more smaller files. i'm trying to do this using splitter – lioshaq Jun 03 '15 at 13:01
  • 1
    What @abarisone means is we need some context on the overall big picture, some context on how big the file is, what is the end goal after splitting and what have you tried so far? – Praba Jun 03 '15 at 13:17
  • a file with 1 milion lines split it to 4 files containing 250.000 lines using camel – lioshaq Jun 03 '15 at 13:21

1 Answers1

0

This should do the trick for you.

.split().tokenize("\n", 250000).streaming()
  .to(file://directory)
.end()

You can also use another endpoint instead of .to(file://).

soilworker
  • 1,317
  • 1
  • 15
  • 32
  • 3
    You would also need to set a new file name so the files are writes using a new name, otherwise the file will be overriden (default behavior). – Claus Ibsen Jun 03 '15 at 16:41