Skip to content

Commit

Permalink
Correctly escaped double quotes in field value
Browse files Browse the repository at this point in the history
  • Loading branch information
geekscrapy committed Jun 30, 2018
1 parent a70b04a commit b91d39d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parsebrologs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def to_escaped_csv(self, safe_headers=False):

data_temp = sorted(self.data.get("data"), key=lambda record: record.get("ts"))
for record in data_temp:
csv += delim.join([ "\"{}\"".format(v.strip()) for v in record.values() ])
csv += delim.join([ "\"{}\"".format(v.strip().replace('"',"\\\"")) for v in record.values() ])
csv += "\n"

return csv[:-1] # Remove trailing line
Expand Down

0 comments on commit b91d39d

Please sign in to comment.