Ask Your Question

Convert Rows (with text) to Columns [closed]

asked 2017-03-03 21:44:42 +0100

talkinggoat gravatar image

updated 2020-09-24 16:03:05 +0100

Alex Kemp gravatar image

I am trying to import a list of words, to convert to flashcards, four per-page. I figured out how to convert them to a table, using Table > Convert > Text to Table, but it is a list, only separated by a paragraph. Therefore, writer puts each word in its own row. How can I make writer separate the word list into 2 columns?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-24 16:04:27.446771

2 Answers

Sort by » oldest newest most voted

answered 2017-03-04 20:45:29 +0100

If you use AltSearch extension, you may use ([^\n]+)\p([^\n]+)\p regex as search string, and $1\t$2\p as replacement, to convert the text to the form that will be convertible to what you need (convert one-column list to two-columned separated by tabs). Just use this once with "Replace All".

edit flag offensive delete link more


Isn't the $1 LibO specific and AltSearch uses the more common \1 instead in the replacement line?

Lupp gravatar imageLupp ( 2017-03-04 22:28:19 +0100 )edit

answered 2017-03-03 22:27:15 +0100

Lupp gravatar image

updated 2017-03-04 19:07:06 +0100

I wouldn't claim I understood exactly what you wanted to achieve.
What structure has your "list of words"? A pair of words per paragraph (as may be default for flashcards)? If so you simply need to assure an unambigous delimiter between the words. The 'Text to Table' tool offers a field 'Other:' where you can enter your space or whatever delimiter you use. If using the space you cannot have phrases in the place of words, of course.

Generally you might be better off with Calc where you have much more powerful tools for tasks of the kind.

(Editing with respect to the comments by @talkinggoat:)
You won't get what you want in 'Writer' using a standard tool, imo. Even using the Extension 'AltSearch' you cannot skip every other paragraph.
It is (rather) simple using Calc, however. You may try this attached example. There are many ways to modify the solution.

edit flag offensive delete link more


Thanks for the quick response. The text to table tool works flawlessly, however, each word is placed into its own row. If I want 4 flashcards per 8x11" page, I need the table to be 2x2 or 2 rows x 2 columns. It isn't the delimiter that doesn't work, it's re-formatting the output, so that every other word is in the second column. Step 1 is to get Writer to put every other word into a second column or join every other row with the row preceding it, making 2 columns.

talkinggoat gravatar imagetalkinggoat ( 2017-03-03 23:05:42 +0100 )edit

This sound as if I guessed wrongly concerning the structure of your list. Would you mind to tell how it actually is?
I'm afraid, the 'Text to Table' tool isn't interested in words but in delimiters. It will always create a new row for each paragraph in the original selection. You only can split to columns by a different delimiter used in the paragraphs internally.A new columnfor each delimiter even if there is no word in between.

Lupp gravatar imageLupp ( 2017-03-03 23:30:34 +0100 )edit

The structure of the list consists of a single column of words, separated by a paragraph.

talkinggoat gravatar imagetalkinggoat ( 2017-03-04 17:56:45 +0100 )edit

Question Tools

1 follower


Asked: 2017-03-03 21:44:42 +0100

Seen: 2,024 times

Last updated: Mar 04 '17