separates data analysis and file access

and uses cvs modul for creating the cvs file