# Transform a CSV file into multiple CSV files using Akka Stream

**URL:** https://discuss.akka.io/t/transform-a-csv-file-into-multiple-csv-files-using-akka-stream/3142
**Category:** Akka Streams & Alpakka
**Created:** [January 12, 2019, 4:44pm UTC](https://discuss.akka.io/t/transform-a-csv-file-into-multiple-csv-files-using-akka-stream/3142 "2019-01-12T16:44:04Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![ennru](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/ennru/32/1495_2.png) [@ennru](https://discuss.akka.io/u/ennru)
#### Post date: [June 1, 2020, 11:50am UTC](https://discuss.akka.io/t/transform-a-csv-file-into-multiple-csv-files-using-akka-stream/3142/6 "2020-06-01T11:50:04Z")

</div>

Hi Syed,

You’re right `prefixAndTail` would need some examples to show the different use cases.

This example in the current docs for `futureFlow` might help you: [https://doc.akka.io/docs/akka/current/stream/operators/Flow/futureFlow.html#examples](https://doc.akka.io/docs/akka/current/stream/operators/Flow/futureFlow.html#examples)

The idea is to use `prefixAndTail(1)` to get access to the first element, extract what you need to create the sink and put it back into the stream to be written.

Cheers,  
Enno.

---

_[View the full topic](https://discuss.akka.io/t/transform-a-csv-file-into-multiple-csv-files-using-akka-stream/3142)._
