LibreOffice macro - end of line regular espression?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
nsivin
Level 3
Level 3
Posts: 148
Joined: Sun May 17, 2009 5:47 pm

LibreOffice macro - end of line regular espression?

Post by nsivin »

In the current version of LibreOffice, It is possible to search for an end of line using $ as a regular expression. I have been using the alternate find command (a macro), which is much more flexible than the one built into LO. In it, using $ as a regular expression does not work. What can I use instead? I am trying to record a macro that finds EOLs and converts them into spaces.
------------------
Nathan Sivin
History and Sociology of Science
University of Pennsylvania
nsivin@sas.upenn.edu
www.ccat.sas.upenn.edu/~nsivin

deepakdeshp
Level 16
Level 16
Posts: 6989
Joined: Sun Aug 09, 2015 10:00 am

Re: LibreOffice macro - end of line regular espression?

Post by deepakdeshp »

A suggestion. If posted to Libre office community there will be better response
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

I am using Mint 19.3 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

nsivin
Level 3
Level 3
Posts: 148
Joined: Sun May 17, 2009 5:47 pm

Re: LibreOffice macro - end of line regular espression?

Post by nsivin »

I have posted it to the LibreOffice community and received no response at all.
------------------
Nathan Sivin
History and Sociology of Science
University of Pennsylvania
nsivin@sas.upenn.edu
www.ccat.sas.upenn.edu/~nsivin

DeMus
Level 6
Level 6
Posts: 1029
Joined: Sat Aug 15, 2009 5:11 pm

Re: LibreOffice macro - end of line regular espression?

Post by DeMus »

Back in the old days a return was shown as \0D (0D = zero D, or character 13 in decimal). Maybe that still works.
I have no idea if it does.

nsivin
Level 3
Level 3
Posts: 148
Joined: Sun May 17, 2009 5:47 pm

Re: LibreOffice macro - end of line regular espression?

Post by nsivin »

I tried \0D on both the alternate and built-in search, and it doesn't work as a regular expression or as a string.
------------------
Nathan Sivin
History and Sociology of Science
University of Pennsylvania
nsivin@sas.upenn.edu
www.ccat.sas.upenn.edu/~nsivin

lmuserx4849

Re: LibreOffice macro - end of line regular espression?

Post by lmuserx4849 »

nsivin wrote:In the current version of LibreOffice, It is possible to search for an end of line using $ as a regular expression. I have been using the alternate find command (a macro), which is much more flexible than the one built into LO. In it, using $ as a regular expression does not work. What can I use instead? I am trying to record a macro that finds EOLs and converts them into spaces.
I'm not sure if I understand where you are in LibreOffice, but I have some thoughts that might help.

Go to: Edit -> Find & Replace or ctrl-H. Expand the "Other options" and check "Regular expression".

To see some help on supported metacharacters, click the Help button, scroll down to "Regular expressions" and click "List of Regular Expressions". Notice it says "\n" represents a line break that was entered via shift-enter. Visually it looks like an arrow. If you click on the "Toggle Formatting Marks" or ctrl-F10 you can see them. "$" still means end of paragraph. Visually it looks like a backward "P".

Line wrapping at the "Text Boundaries" is neither EOL or NL.

You might be interested in: Removing Line Breaks.

The option might have moved. I followed the steps below and the text I copied with lots of paragraphs was reformatted. You can see this by the ctrl-F10 option mentioned above.
  1. Tools -> AutoCorrect ->AutoCorrect Options
  2. Options tab, Scroll down and find "Combine single...."
  3. Double-click the number and enter a value. Make it small.
  4. Tools -> AutoCorrect -> Apply

nsivin
Level 3
Level 3
Posts: 148
Joined: Sun May 17, 2009 5:47 pm

Re: LibreOffice macro - end of line regular espression? [SOLVED]

Post by nsivin »

I tried 4849's solution (see the first line) and it worked. It is clear that in the alternate search, searching for $ as a regular expression does not work, and in the default search & replace it does. Many thanks!
------------------
Nathan Sivin
History and Sociology of Science
University of Pennsylvania
nsivin@sas.upenn.edu
www.ccat.sas.upenn.edu/~nsivin

Post Reply

Return to “Newbie Questions”