clementfarabet / lua---csv

A package to read and write CSV. Provides high-level database-like handlers.
46 stars 16 forks source link

Handle original csv column order #17

Closed AlexMili closed 8 years ago

AlexMili commented 8 years ago

Hello,

I encountered multiple times the need to display my columns - read from a csv file - in its original order. Lua’s table not allowing such a thing, I am proposing a simple way to handle during loading and saving the initial column order.

I added the parameter column_order in save()and load(). For save()it writes the csv according to the column_orderargument instead of the lua-random-table order. For load()the argument simply allows to return ì2key with the tidy data.

Those changes are only available for the tidymode.

I hope it could be useful.

soumith commented 8 years ago

Thanks Alex! :)