Finished multi-threaded version. Now it opens multiple data files simultaneously; very quick :-) But also more memory intensive because it stores whole csv file in memory before writing it, if this is a problem I can improve it to write as it goes.