angular-csv-ext icon indicating copy to clipboard operation
angular-csv-ext copied to clipboard

Random column order?

Open Abelhawk opened this issue 5 years ago • 3 comments

Hey, I was wondering what this library's algorithm is for ordering columns when exporting. On my end it seems to be random. Is there a way to assign a specific order for them to appear in in the CSV file?

Abelhawk avatar May 29 '19 16:05 Abelhawk

@Abelhawk So far what I have observed is that column order is the order in which you define the columns and assigns the value to each column. If you want the columns in specific order, define them in the same order. Hope it helps.

madhav5589 avatar Jun 24 '19 20:06 madhav5589

It would be really nice if the parser followed the headers!

drwharris avatar Jul 29 '19 01:07 drwharris

I've just run into this as well. It appears to be a javascript limitation. Easiest solution is to simply create a new array and as you construct it, insert data in desired order.

CAspeling avatar Sep 25 '19 02:09 CAspeling