I have two string arrays: one with date and another with temperature. Both arrays are huge.
Ex: dateValues array has elements like: 2023-07-01T00:00, 2023-07-01T01:00
,….
temperatureValues has elements like: 38.4, 29.2
,….
I want to combine both and it should look like this:
2023-07-01T00:00,38.4
2023-07-01T01:00,29.2
.....
I want to write combined array to a csv file.
Tried chain command
for (x, y) in zip(dateValues, temperatureValues) {
let val = x + "," + y + "n"
try csvValues(val)
}
print(csvValues)
I get error on the try line: Cannot call value of non-function type ‘[String]’. How to fix this?