Added more csv character escaping

This commit is contained in:
neviyn 2021-07-19 15:13:49 +01:00
parent 06d2d8ffdb
commit 71a1144680

View File

@ -95,7 +95,7 @@ data class Observation(
fun escapeSpecialCharacters(data: String): String {
return data.replace("\"", "\"\"").replace("\n", ";")
}
val dataPortion = "${date.toString("dd/MM/yyyy")},\"$person, ${type.name} ${scenarios.joinToString { it.title }}\"," +
val dataPortion = "${date.toString("dd/MM/yyyy")},\"${escapeSpecialCharacters(person)}, ${type.name} ${scenarios.joinToString { escapeSpecialCharacters(it.title) }}\"," +
"\"Training\",\"Operations - Shift Operations\",\"${site.name}\",\"N/A\"," +
"${roundScore(monitoring)},${roundScore(controlProcedural)},${roundScore(control)}," +
"${roundScore(conservatism)},${roundScore(teamworkCommunications)},${roundScore(teamworkLeadership)}," +