re-formatting text

Asked by igorsand

Re-formatting text in Open Office
I have a text file which is pre-formatted in such a way that it occupies only half of the the page width. I was not able to find out how to reformat it automatically to make whole width of the page filled. I tried to make search for the line-breaking signs in order to replace them by spasing. The search simply does not see this sign ( under Windows in MS office this is possible to do). Any help?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openoffice.org Edit question
Assignee:
No assignee Edit question
Solved by:
igorsand
Solved:
Last query:
Last reply:
Revision history for this message
GercoKees (gercokees) said :
#1

hi,
search for newlines (shift+enter): "\n"
search for paragraph ends: (enter): "$"
be sure to check: enable regular expresions in your search-dialog (press "more-options")

succes

Revision history for this message
Scutiform (brian-blue-skys) said :
#2

I have a similar problem with a text file. The text is pre-formated to occupy only the left side of the page. Each line terminates not with the normal Enter/CR arrow, but a character like two vertical bars with a blob on the top left corner (I hope this makes sense) I can edit it line by line to join two lines into one, but the document is 500 pages long.

Revision history for this message
GercoKees (gercokees) said :
#3

You mean this character:
http://en.wikipedia.org/wiki/Pilcrow

:-)

edit > find and replace > more options > check regular expressions >
search for: "$" (pilcrow sign)
replace with: " " (space)
(do not use the quotation marks...)

Revision history for this message
Scutiform (brian-blue-skys) said :
#4

Thanks, it worked. All I have to do now is read the whole document and tidy it up :o

Revision history for this message
igorsand (igorsand) said :
#5

Thanks to GercoKees: the key is to use "regular expressions" option. Unfortunately, this is not exatcly what I'd liked to find out. It does not find the end of line "\n" but finds paragraphs (when I "asked") to find "$" sign, and I use it reformats the text to full width but at the same time the paragraphs are mixed up and the logical structure of the document is lost.
I expected that one can change the text width just by means of sliding the width pointer on the upper bar with ciphers.
This does not work, at least, by default. I wonder, if such option exists at all in OpenOffice? Thanks.

Revision history for this message
Cruncher (ubuntu-wkresse) said :
#6

Well, while this would be a nice feature, all I can think of off the top of my head is a two-way workaround, which is a bit cryptic, but will work.
Note that it will only work if paragraphs are separated by an empty line.
- enable regular expressions
- search and replace "^$" with "secretstring" (without the quotes, and you can use any unambiguous string instead of "secretstring"
- search and replace "$" with " " (the latter is just a space)
- search and replace " secretstring" with "\n" (there is a space in front of the word, and the slash needs to be a backslash)

If paragraphes are not separated by empty lines, it gets really complicated. In that case you can experiment with the same procedure, but you need to guess when a new paragraph starts. For example, you can assume if there is a CR after a fullstop, that a new paragraph should be started. So you can replace the "^$" in the above example ('^' meaning "beginning of line") with ".$". And so on.

Revision history for this message
igorsand (igorsand) said :
#7

 This, in essence, means that this is possible to do only "by hands", not with some inner OpenOffice tools. It's really a pity... But, anyway, thanks for suggestions and your time!