Stream if-else branching - splitting lines of files into two files?

Suppose I have a text file. I need to split lines of the file based on an if-else condition into two different files. Since it is very large, I want to iterate over it just only once. Could one tell me how to achieve this?
This is an example for a flow with a source and two sinks. Thanks!

1 Like