Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Leemos el archivo de Peatones 2019
var csvReadOptions2019 = CSVReadingOptions(hasHeaderRow: true, delimiter: ";")
// Tratamiento para las fechas
// El formato es 16/08/2022
csvReadOptions2019.addDateParseStrategy(
Date.ParseStrategy(format: "\(day: .twoDigits)/\(month: .twoDigits)/\(year: .defaultDigits)",
locale: Locale(identifier: "es_ES"),
timeZone: TimeZone.current)
)
let columnTypes2019 = [
"FECHA" : CSVType.date,
"HORA" : CSVType.string,
"PEATONES" : CSVType.string,
"DISTRITO" : CSVType.string,
"NOMBRE_VIAL" : CSVType.string,
"NÚMERO" : CSVType.integer,
"CÓDIGO_POSTAL" : CSVType.string,
"LATITUD" : CSVType.string,
"LONGITUD" : CSVType.string
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment