Writing script for preprocessing of data