neo4j-labs / neodash

NeoDash - a Dashboard Builder for Neo4j
https://neo4j.com/labs/neodash/
Apache License 2.0
420 stars 141 forks source link

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

Closed GQ16 closed 1 year ago

GQ16 commented 1 year ago

When using the Table Output in NeoDash and allowing for CSV download, the CSV itself formats the results strangely and in a way that is problematic for users who depend on these extracts.

Expected, Ideal behavior:

Actual behavior from "Download CSV" from NeoDash Visual:

JonanOribe commented 1 year ago

I'm currently working with the CSV download system on another issue, so I'll check this one out as well.

nielsdejong commented 1 year ago

Perhaps something additional that can fit in here?

From a user: When you download a table as csv, then the value 5 will be exported as  {“low”:5;“high”:0}

We should make sure to cast the javascript integers to human readable numbers when doing an export as a quick check.

JonanOribe commented 1 year ago

Perhaps something additional that can fit in here?

From a user: When you download a table as csv, then the value 5 will be exported as  {“low”:5;“high”:0}

We should make sure to cast the javascript integers to human readable numbers when doing an export as a quick check.

Ok, I add this one to task list.

JonanOribe commented 1 year ago

Currently, I just PR a solution for the leading spaces problem. @GQ16 what version of Excel are you using? I'm not able to reproduce the problem with the quotes

On database: image

On Excel: image

GQ16 commented 1 year ago

@JonanOribe It's the latest version of excel I believe which is 2019?

Here is what I see when I export from NeoDash. Still the same issue. image

GQ16 commented 1 year ago

@JonanOribe, I've made a discovery. It appears to me that the leading space in front of all the data in the columns (except for column 1, which doesn't have the leading space issue) is the reason excel keeps the quotes. If you eliminate the leading space, the quotes automatically drop off as expected. (Of course, ignore the missing spaces between the actual string, that was a byproduct of me removing all the spaces)

Here is what happened after I removed the leading spaces using notepad before opening in excel: image

NanisTe commented 1 year ago

@JonanOribe would you also mind looking at an example which includes a comma in the text columns? This also breaks any csv import because there is no possibilty to change the column separator type during export.

This problem will now especially problamatic since the quotes now disappear and a comma in the text column could be identified as a column separator.

JonanOribe commented 1 year ago

No worries @NanisTe , I will add this one too to the task list

BennuFire commented 1 year ago

Closed with 2.2.4

GQ16 commented 1 year ago

I'm still dealing with this issue after the latest update. I have to go into Notepad and do a find and replace on all the commas with a space after ", " and replace them with just commas "," Once I do that, the file opens in excel without all the additional quotation marks. The leading spaces in front of all the columns other than the first is causing the issue.

GQ16 commented 1 year ago

@nielsdejong @BennuFire @JonanOribe Here is a quick 1-minute video where I walk through exactly what I'm doing and showing the exact issues. https://youtu.be/NYhlgIYiNdk