I am having a problem when exporting grid content to CSV.
There are some fields that contains free text. Some of them contains ‘,’ (comma) character. I noticed DhtmlXGrid component does not generate a CSV with quote-delimited text. It means that if I try to load the generated CSV, it will incur in errors, since the “extra” comma will make the program (used to load CSV) thinks that a new field should be created (instead of meaning a comma character).
Does DhtmlXGrid contain any method in order to prevent that ?
Thanks.
You should change CSV delimiter:
mygrid.setCSVDelimiter(“any_single_char”);
Hi.
I’m aware of the setCSVDelimiter() method, but I was looking for something that would control the text fields.
E.g,:
DhtmlXGrid content:
Name | Age | Description
Steve | 19 | Likes pizza, skate and punk music.
John | 23 | Likes spending time watching TV series, movies and reading books.
Sarah | 27 | Dislikes noise environments, but likes live rock concerts.
Expected CSV output would be:
Name,Age,Description
Steve,19,“Likes pizza, skate and punk music.”
John,23,“Likes spending time watching TV series, movies and reading books.”
Sarah,27,"Dislikes noise environments, but likes live rock concerts."
Do we have this functionality ?
I did not want to use a different delimiter character since comma is the default one.
Thanks.
I also need this functionality. This data imports incorrectly:
Data1,Data2,“Data3-1,Data3-2,Data3-3”,Data4
Is there a way to include all Data3 in the same cell, whilst stripping out the quotes when displayed?
Thanks.
Existing stable version has not such ability, but dev. version has alternative CSV parser, which can process such data correctly ( works a bit slower )
If you interested - I can provide an updated file.
That would be most helpful. Thanks for the quick response. We have the pro version and are loving it.
Try to use the attached js file instead of the original one.
To enable new CSV parse, add the next line to grid’s initialization
grid.csvParser = grid.csvExtParser;
dhtmlxgrid_nxml.zip (5.26 KB)