Writing to a sharded text file in parallel