# Problems with processing fast occurring elements in stream

**URL:** <https://forum.elixirforum.com/t/problems-with-processing-fast-occurring-elements-in-stream/36462>\
**Category:** Questions\
**Tags:** streams, streamdata, console\
**Created:** [December 27, 2020, 5:32pm UTC](https://forum.elixirforum.com/t/problems-with-processing-fast-occurring-elements-in-stream/36462 "2020-12-27T17:32:28Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![al2o3cr](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/al2o3cr/32/3457_2.png) [@al2o3cr](https://forum.elixirforum.com/u/al2o3cr)\
**Post date:** [December 28, 2020, 1:20am UTC](https://forum.elixirforum.com/t/problems-with-processing-fast-occurring-elements-in-stream/36462/3 "2020-12-28T01:20:18Z")

</div>

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:

```elixir
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"]

```

---

_[View the full topic](https://forum.elixirforum.com/t/problems-with-processing-fast-occurring-elements-in-stream/36462)._
