Commit 07ce48de authored by pengxin's avatar pengxin

导出CSV特殊符号处理。

parent b07f01a8
......@@ -396,6 +396,10 @@ public class DatasetOutputServiceImpl extends BaseService<DatasetOutput, Long> i
instruction = instruction.replaceAll("\n", " ");
output = output.replaceAll("\n", " ");
// 将包含逗号的字符串用双引号包围,并转义其中的双引号
instruction = "\"" + instruction.replaceAll("\"", "\"\"") + "\"";
output = "\"" + output.replaceAll("\"", "\"\"") + "\"";
pw.println(instruction + "," + output);
}
pw.flush();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment