add a script to collect data into a .csv file.
bug of 'SUB' fixed