1

Windows 10, Emacs 25.1.

Suppose I has the next text

OrganizationName    GUID

Advertisment    aaaaaaaa-14d7-4af5-ad10-ccccccc

Anelik  1c970d12-6c67-44e1-aa3f-bbbbbbbbb

I need to convert this text to table in org mode. So result must be like this:

| OrganizationName | GUID                                 |    
|------------------+--------------------------------------|    
| Advertisment     | aaaaaaaa-14d7-4af5-ad10-ccccccc      |    
| Anelik           | 1c970d12-6c67-44e1-aa3f-bbbbbbbbb    |

So I wan't do this line by line. Maybe has faster approach?

2 Answers 2

6

org-mode has org-table-create-or-convert-from-region, bound to C-c |. Just select the region you want to convert beforehand. You can use C-c - at the end of the first line to insert the dashes. Org Tables explains this in great detail.

0

Another option is to use the multiple-cursors package to insert the | as needed. Just put a cursor at the beginning of each line, then it's just C-nC-S-BackspaceC-p to remove the blank lines and return the cursors to the beginning of each row-line, then |M-e|EscTab to insert the pipes at the beginning and after each first-word, escape multi-cursors mode, and get org-mode to format the table. After that, you just need to insert a blank line below the header, type |- and hit Tab to insert that horizontal line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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