Hello,
I have a large document where indentation is required. I'd like to automate this process. I think I need two different commands.
I've enclosed a file which shows the lay out of the original document and the desired lay out (below the xxxx line).
Command for situation 1:
'A' appears on a line, followed on the next line by a paragraph. I'd the 'A' to be removed and the following paragraph to be indented.
Command for situation 2:
A line starts with double quotation marks. I'd like this line to be indented.
Does anybody know a simple way to do this, that doesn't involve writing an extensive script or something?
Help much appreciated!
Regards,
Specs:
Version: 25.8.1.1 (X86_64)
Build ID: 54047653041915e595ad4e45cccea684809c77b5
CPU threads: 8; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Vulkan; VCL: win
Locale: nl-NL (en_GB); UI: en-GB
Calc: threaded
[Dropped] Queston regarding indentations
[Dropped] Queston regarding indentations
- Attachments
-
- lorem.odt
- (24.04 KiB) Downloaded 6 times
Last edited by MrProgrammer on Wed Oct 15, 2025 8:31 pm, edited 2 times in total.
Reason: Dropped: Suggestions provided; No reply from Bassloopi
Reason: Dropped: Suggestions provided; No reply from Bassloopi
Open Office 4 on Windows 11
Re: queston regarding indentations
There's no attached file.
assuming i've understood you anyway...
Make a copy of your document first.
For situation 2, with the Find Replace dialog and regular expressions ticked you can find all lines begining with "" by searching for
^"".*
With those selected with find all you can apply whatever changes you want including the indent or better apply a paragraph style with the indent you want.
For situation 1,
With regular expressions ticked again
have you got any empty paragraphs in your document?
If not skip this bit otherwise do a search for
^$
and replace with
markpara\n
or anything not already in your document instead of markpara
So all your empty paragraphs are marked differently
Next
^A$
finds all paragraph with just contain A. Replace those with an empty replace box
Those paragraphs with then be empty ones
then Search for
^$
which finds empty paragraphs and replace those with
""
You will then have paragraphs beginning with "" which is your first case.
(And you can restore the empty paragraphs you had by looking for markpara and replacing it with nothing.)
assuming i've understood you anyway...
Make a copy of your document first.
For situation 2, with the Find Replace dialog and regular expressions ticked you can find all lines begining with "" by searching for
^"".*
With those selected with find all you can apply whatever changes you want including the indent or better apply a paragraph style with the indent you want.
For situation 1,
With regular expressions ticked again
have you got any empty paragraphs in your document?
If not skip this bit otherwise do a search for
^$
and replace with
markpara\n
or anything not already in your document instead of markpara
So all your empty paragraphs are marked differently
Next
^A$
finds all paragraph with just contain A. Replace those with an empty replace box
Those paragraphs with then be empty ones
then Search for
^$
which finds empty paragraphs and replace those with
""
You will then have paragraphs beginning with "" which is your first case.
(And you can restore the empty paragraphs you had by looking for markpara and replacing it with nothing.)
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: queston regarding indentations
Corrected last post - search for
^"".*
to find paragraphs beginning with "" at the start of the paragraph.
Note: the reason the 'A' case has to be more complicated is you want to change the following paragraph (not the current paragraph of something you searched for) but OO search and replace is based on finding and changing paragraph contents, not anything beyond a paragraph.
^"".*
to find paragraphs beginning with "" at the start of the paragraph.
Note: the reason the 'A' case has to be more complicated is you want to change the following paragraph (not the current paragraph of something you searched for) but OO search and replace is based on finding and changing paragraph contents, not anything beyond a paragraph.
Last edited by JeJe on Tue Oct 07, 2025 5:55 pm, edited 1 time in total.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: queston regarding indentations
I've seen the attached document now. As above, but “ instead of "" which is what I assumed you meant by double quote.
Edit:
Search for
^\t“.*
as those lines start with a tab
Edit:
Search for
^\t“.*
as those lines start with a tab
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: queston regarding indentations
You can keep "" for the A situation (anything else unique will do). When your lines begin with "" you can select all those with a search for
^"".*
And apply your indent. Then search for "" and remove them.
^"".*
And apply your indent. Then search for "" and remove them.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: queston regarding indentations
You can use paragraph styles for that.
If you want the same indentation for both cases, you can use one paragraph style and apply it to the entire text.
If you want different indentation, use an inbuilt style (Body text, indented seems a good one) and derive a style from it, and change only the indentation. First apply the inbuilt style, then use Find as @JeJe explained to select all paragraphs starting with " (first get rid of the tabs), close the Find dialog box and then apply the second style to the selection. You can easily delete the A (but not so easily remove the line it sits on).
If you want the same indentation for both cases, you can use one paragraph style and apply it to the entire text.
If you want different indentation, use an inbuilt style (Body text, indented seems a good one) and derive a style from it, and change only the indentation. First apply the inbuilt style, then use Find as @JeJe explained to select all paragraphs starting with " (first get rid of the tabs), close the Find dialog box and then apply the second style to the selection. You can easily delete the A (but not so easily remove the line it sits on).
LibreOffice 24.2.7.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum