Hi,
I am trying to figure out a solution using Akka Stream but after spending couple of days couldn’t figure out how to solve this particular problem.
Following is my problem:
Given a Source[String, NotUsed]
, following is an example of source:
abc,...,....
xyz,...,..
lmn,...,...
xyz,...,...
abc,...,...
Now we need to transfer given source to Source[Map(String, Seq[String), NotUsed]
, where key of the map is the first value of each line of CSV
file. Once we have this we need to save the values of each key-value pair in separate file (actually it needs to save in the S3
) where name of the needs to be in the following format:
<key>_<length_of_seq>_<random_generated_uuid>.csv
For example, name of one the file would be:
abc_2_d339f8f8-92b8-46f2-bdd0-31406e9c44da.csv
and its content would be:
abc,...,....
abc,...,....
Any suggestion how to approach this?
Regards,
Syed