How to copy table contents from LibreOffice writer to plain text?

3

If I select a table's contents and try to paste it into a plain text document, the layout gets severely broken.

+-----+----+
|one  |two |
+-----+----+
|three|four|
+-----+----+

becomes, regardless if I use Ctrl C/V or select/MMB,

one
two
three
four

Is it possible to get something like

one<tab>two
three<tab>four

or any other separator between cells except <linebreak>? The workaround with Calc can't be the only way...

Jasper

Posted 2015-02-05T12:43:35.850

Reputation: 798

Answers

2

You can use a tool such as Pandoc to convert LibreOffice ODT (and many other formats) to a plain text markup (e.g. Markdown, reStructuredText, AsciiDoc, MediaWiki, DokuWiki, Textile`).

A quick online test at Try Pandoc produced this:

Markdown

Test
====

  --------- -----
  Apples    100
  Oranges   77
  --------- -----

------------------------------------------------------------------------

PHP Markdown Extra

Test
====

|---------|-----|
| Apples  | 100 |
| Oranges | 77  |

------------------------------------------------------------------------

ReStructuredText

Test
====

+-----------+-------+
| Apples    | 100   |
+-----------+-------+
| Oranges   | 77    |
+-----------+-------+

--------------

and so on

RedGrittyBrick

Posted 2015-02-05T12:43:35.850

Reputation: 70 632

1

This is an easy task:

Menu Table -> Convert -> Table to text.... Now, you can select the separating character:

enter image description here

tohuwawohu

Posted 2015-02-05T12:43:35.850

Reputation: 8 627

But I don't want to edit the source document... – Jasper – 2015-02-05T14:07:59.587

1You don't need to. Copy the table in a new LO Writer document, convert it as described and save as text (or copy&paste the output of the conversion). – tohuwawohu – 2015-02-05T14:13:08.320