Write cluster result to file