add a function to putput array data to the cvs file