mirror of https://gitee.com/bigwinds/arangodb
arangoexport fix csv export escaping
This commit is contained in:
parent
02c021f7a6
commit
ed8e939a10
|
@ -398,7 +398,11 @@ void ExportFeature::writeCollectionBatch(int fd, VPackArrayIterator it, std::str
|
||||||
}
|
}
|
||||||
|
|
||||||
value = std::regex_replace(value, std::regex("\""), "\"\"");
|
value = std::regex_replace(value, std::regex("\""), "\"\"");
|
||||||
value = std::regex_replace(value, std::regex(","), "\",");
|
|
||||||
|
if (value.find(",") != std::string::npos || value.find("\"\"") != std::string::npos) {
|
||||||
|
value = "\"" + value;
|
||||||
|
value.append("\"");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
line.append(value);
|
line.append(value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue