Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions WebApp/src/uk/ac/exeter/QuinCe/data/Export/ExportOption.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,12 @@ public ExportData makeExportData(DataSource dataSource, Instrument instrument,
*
* <p>
* Newlines are replaced with semicolons. Instances of the separator are
* replaced with spaces.
* replaced with spaces. Double quotes are escaped.
* </p>
*
* @param fieldValue
* @return
* The value to be formatted.
* @return The formatted value.
*/
public String format(String fieldValue) {
String result = null;
Expand All @@ -430,7 +431,8 @@ public String format(String fieldValue) {
} else {
String newlinesRemoved = fieldValue.replaceAll("[\\r\\n]", " ");
String separatorsRemoved = newlinesRemoved.replaceAll(separator, " ");
return separatorsRemoved;
String quotesEscaped = separatorsRemoved.replaceAll("\"", "'");
return quotesEscaped;
}

return result;
Expand Down