Converts JSON input to CSV