this function is used to change the filetype form mat to txt