write reducer output to file