If you have a stream of values that sometimes have more than one \n-delimited value, you can transform them to a stream that has them one at a time:
a = ["1\n", "2\n3\n", "4\n"]
iex(4)> Stream.flat_map(a, &String.split(&1, "\n", trim: true)) |> Enum.to_list()
["1", "2", "3", "4"]


















