Fix number of csv array elements in json array

- Output file name written in write() method