esvit / ng-table-export

Export data from ngTable to CSV
BSD 3-Clause "New" or "Revised" License
44 stars 95 forks source link

Exported file used ";" instead of "," as separator #12

Open UMAknow opened 10 years ago

UMAknow commented 10 years ago

When opening the file with Excel on a Mac, it works just fine, but on a PC, Excel expects the separator to be a comma, not a semicolon.

An easy fix is to change a line in the code such as to insert 'sep=;' at the very top of the file. Then it works fine both on Excel Mac and Windows.

generate: function() {
    data = 'sep=;' + "\n";
TheKojuEffect commented 9 years ago

+1

juniorplenty commented 9 years ago

+1

shoobm commented 9 years ago

+1

nerezo commented 9 years ago

In my opinion, this addon should not regard and deal with separators. May be it can take the separator from outside and can use a default one if nothing specified.

floydpink commented 9 years ago

Since this repo was not being updated, we forked it and have changed the default separator to be comma with the option to specify any others via a new custom attribute of separator

Check out the plunker that shows this in action - http://plnkr.co/Y0r33F

Here is the fork (that we have renamed as well to publish into bower) - https://github.com/kollavarsham/ng-table-to-csv

Also, we would welcome any other suggestions that could improve the library.