Converts json arrays into csv