vim-table-mode icon indicating copy to clipboard operation
vim-table-mode copied to clipboard

Request: export table

Open DerWeh opened this issue 7 years ago • 6 comments

Would it be possible, to export the table-mode tables to html? It looks like a simple replacement for Excel, less feature rich but way faster to just write small tables. The only thing I am missing, is getting it in a printable format.

Sadly I have to admit I have no idea of such things, hence I don't know if I am asking the impossible. I just saw the feature in vimwiki and thought it would be awesome. You already stat:

For Markdown-compatible tables use

let g:table_mode_corner="|"

I think this should then be easily be possible to convert to html.

DerWeh avatar Nov 19 '16 18:11 DerWeh

Hi,

Yes it would be possible, and fairly easy to convert the tables to html tables, however I am not entirely sure how to close that loop, as in where to place the html tables etc.

dhruvasagar avatar Nov 20 '16 02:11 dhruvasagar

Hi, I'm think ability to convert table into CSV data would be a cool feature. CSV is on of the most common ways to store tables. Thus it'll be possible to export it in DB, xls, etc. Also ability to convert CSV to table already implemented, so command that toggle it would be amazing. I'm not very familiar with VimL, but i can try to make PR if it'll demand.

k33nice avatar Jan 11 '17 21:01 k33nice

Exporting to CSV would be much more portable indeed.

NicolasWebDev avatar Feb 25 '17 22:02 NicolasWebDev

Should we exported it to a user defined path or just in a new buffer ?

dhruvasagar avatar Dec 13 '17 16:12 dhruvasagar

IMO, buffer would be better. User may not want to save it to fs, on the other hand buffer can be easily saved if needed. Thus it will be more flexible.

k33nice avatar Jan 17 '18 17:01 k33nice

I understand that you want to export vim-table-mode table into CSV through VimL. I need that feature too as I use vim-table-mode to keep a log of expenses while I work as a tour guide for a group of people. After each trip, I have to convert it into LibreOffice Calc file and add spreadsheet formulas in order to charge the expenses to each of them. My customers expect to get the report in Microsoft Excel format, which I then have to convert it again from LibreOffice Calc. It's like using vim-table-mode while I work, then export it into a spreadsheet format for end-users who don't quite understand text file (!). So, while waiting for you to add this feature into vim-table-mode, I have written a small Python script to do just that so I would like to share it just in case someone needs to use it now.

https://github.com/unsigned-nerd/vim-table-mode-to-csv/blob/master/src/vtmtc.py

unsigned-nerd avatar Apr 14 '18 16:04 unsigned-nerd