Chinese Spectral RadioHeliograph (CSRH) is a new generation of solar radio telescope which produces 0.1 megabytes raw observational data in every 3 milliseconds. The raw data with self-dened format must be converted to a standard scientic data for-mat to meet the requirements of the astronomical software such as Common Astronomy Software Applications (CASA). In this paper, we propose a data preprocessing system for CSRH which especially focuses on the generation technique of FITS Interferometry Data Interchange (FITS-IDI) file based on Python language. The integral architecture of the data format preprocessing system is presented rstly. Secondly, we make a deep analysis on raw data format dened by digital receiver. Thirdly, many valuable techniques such as construction of XML file, data header denition, and quick FITS-IDI le generation are proposed in detail. The le generated by the system has been successfully imported into CASA. This study brings great progress to the data preprocessing system of CSRH and will also provide a reference for other related researches.