2

I have a table in Org mode that looks as shown below

| S.No. | Template       | V800A | V800B |
|-------+----------------+-------+-------|
|    1. | IFD03B         |    17 |     8 |
|    2. | Calcs          |     5 |     5 |
|    3. | ALM_4S_AX04B   |    20 |    16 |
|    4. | ALM_DX05B      |     7 |     2 |
|    5. | ALM_1S_HZD05B  |     2 |     1 |
|    6. | ALM_RERING03B  |     4 |     4 |
|    7. | ALM_DI_DO05B   |    17 |    16 |
|    8. | IS04B          |     2 |     2 |
|    9. | Step06B        |    12 |    14 |
|   10. | DO_INDEPEND06B |     8 |     8 |
|   11. | AO_PID13_01B   |     5 |     5 |
|-------+----------------+-------+-------|
|       | Total          |    99 |    81 |  

But when I paste this content within MS Outlook or MS Excel it looks as shown below.

enter image description here

Why does this behave in such a manner and what should I do to fix this?
Presently, I'm using Text to Columns option (in MS Excel) to convert this into a table and deleting the | and it makes a clean excel table.
For Outlook, I do not have such options to exercise.
Are there any settings to be made into Emacs to fix this?

P.S: I'm on Windows 7 with Emacs 24.5.1 installed. I will attempt this on Ubuntu (+open office) and update the question later.

  • Really simple method no effort 1- select table 2- menu - Tbl - export to file .csv 3- open the file in excel Thanks to Alejandro C. – Alexandre Nassar Jun 29 '16 at 16:37
2

The problem is that org is using space characters for whitespace in the table, and is assuming that you're using a monospace font. If you look closely at your screenshot, you can see that it's using a non-monospace font.

Your simplest option to cut-and-paste into something like Outlook or Word would be to select the pasted table and change it's font to something monospaced, such as Courier New.

| improve this answer | |
  • You may be right. I will try to replace the font type to mono-space fonts. I tried using the copy-paste method with Excel and Word 2016 - It does paste the text using mono-space fonts. – Prasanna Jun 27 '16 at 16:11
2

You probably want to use org-table-export which will take the table under the point and export it to a Tab separated file (which is then easy to copy and paste into excel).

| improve this answer | |
  • +1 for the good idea - i learnt this thing new. But I'd not prefer this method for smaller tables. Its not worth the effort - I think. – Prasanna Jun 27 '16 at 16:09
  • You could try wrapping it for convenience. For example: (defun copy-table-as-tsv () (interactive) (unless (org-at-table-p) (user-error "No table at point")) (lexical-let ((table (org-table-to-lisp (buffer-substring-no-properties (org-table-begin) (org-table-end))))) (kill-new (orgtbl-to-tsv table '())))) – Alejandro C. Jun 27 '16 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.