I have created a script that will export the data in csv file(This is the current output ) but I want it to be in different format. (This is how I want it to be)