code to read/write thermal to cvs