Closed mTsBucy1 closed 2 years ago
Thanks for the bug report. I imagine there's a library out there that would do a better job writing in CSV format, but as our needs are so minimal my goal has been to do so without adding yet another dependency. I'm open to fixing this manually the same as all CSV writing currently, or to adding a new dependency.
The CSV request logs generated by goose include a RAW column that does not properly escape quotes causing many csv readers to confuse column headers.
In particluar this is the first two rows of the CSV requests log unittest. (Running
cargo test --package goose --test logs -- test_requests_logs_csv --exact --nocapture
after commenting out the cleanup of files https://github.com/tag1consulting/goose/blob/main/tests/logs.rs#L316:L322).Which both Google Spreadsheet and Microsoft Excel interpret as (shortened for clarity)
Which clearly is not desireable, since now the rest of the csv heads are shifted over by two columns.
The solution is to propertly escape quotes (see this stackoverflow answer) resulting in this csv output (notice the doubled up quotes in the raw column). This gets property interpreted by both Google Docs and Excel.