What I have
I have a lot of CSV files like below:
Date;Something;
2014-03-31 15:00:01;xxx;
2015-02-01 13:20:01;xxx;
2014-03-03 17:00:03;xxx;
2014-03-03 17:00:04;xxx;
The second row is not a mistake - dates are "random", between 2014 and 2016. Fortunate most dates are similar like 2 last rows. But above sequence is real example.
How may files and why parallel?
There are 5000 files per year. Each one is gziped. So IO is not a problem. CPU is boring now.
What I need
Rows from above files grouped by day in separated files. I don't care about order inside.
What I was thinking about
Using Java parallel stream to read files. But I don't know how I can write thread-safe into multiple files? I found something similar like: Write to text file from multiple threads? and Threads and file writing But I'm not sure if this is a way to go?