Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV Extract from NeoDash adds quotes and leading white space #1012

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 6 additions & 2 deletions src/chart/ChartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,14 @@ export const downloadCSV = (rows) => {
headers.forEach((header) => {
// Parse value
let value = row[header];
if (value && 'low' in value) {
if (value?.low !== undefined) {
value = value.low;
}
csv += `${JSON.stringify(value)}`;
if(typeof value === 'string'){
csv += value;
}else{
csv += `${JSON.stringify(value)}`;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JonanOribe, I think we should keep "stringified strings", in order to avoid this phenomena when string value contains delimiter characters

Non stringified version:
Capture d’écran 2025-01-28 à 15 39 09

Stringified version:
Capture d’écran 2025-01-28 à 15 38 43

csv += headers.indexOf(header) < headers.length - 1 ? ',' : '';
});
csv += '\n';
Expand Down
Loading