How to convert manullay numbers to Toggle Ordered List?

Hello.

I have a file (odt format) where I have manually numbered the beginning of each paragraph.
Now I want to clear the numbers and and convert them to autonumber list (Toggle Ordered List).
The number of paragraphs (numbers) is many.
How should I do this?

Version: 7.4.2.3 / LibreOffice Community
Build ID: 40(Build:3)
CPU threads: 2; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.4.2~rc3-0ubuntu0.22.04.1~lo1
Calc: threaded

Turning an ordinary paragraph into a numbered list item is not an “innocent” operation. You should mention OS name, LO version and save format (.odt or .doc(x)). List numbering is one of the areas where ODF and DOCX differ most. Consequently, if you didn’t save .odt, don’t expect stability.

There are two ways of doing it, but basically, they are manual.

Using List Styles

This is the most "professional" way. You create a **list style** or customise a built-in one (*Numbering 123* is a good candidate) to define both the numbering sequence and the left indent and alignment of your items.
You remove your manual numbering and double-click on the list style name in the side style pane to add it to the paragraph formatting.
**Pro:** - general layout of all your list items can be changed simply by modifying the list style; no longer a need to track manually the occurrence - very easy to restart list numbering (in case your numbered paragraph are not part of a single huge list)
**Con:** list styles are a concept difficult to understand by newbies

Using the toolbar button

This is a vivious form of direct formatting, very hard to tame. The feature was offered to "ease" conversion from Word to Writer but needed many tweaks to allow user to control the lists. The main difficulty is to define the extent of the list. Since the button is valid for **all** lists you may insert (independent lists from each other, some alphabetically numbered, others numberically numbered, …), Writer quickly gets lost if you mix too many lists (whereas with styles, a style defines a list; there is no ambiguity). And you also get lost.
This direct formatting approach may be used to quickly get an idea about your document layout.
Remove the manual number and press the toolbar button.
**Pro:** quick but limited
**Cons:** - impossibility to reformat all lists simultaneously (Writer may have decided you have in fact several lists according to its criteria) - impossibility to save a "user" configuration with `Format`>`Bullet & Numbering` - since this is direct formatting, expect many problems in later steps of document issuance

As always in Wrtiter, the most reliable formatting method is **styling**. I assume from your question you never heard of them (even for paragraphs except perhaps for the *Heading n* family). I recommend you read the [Writer Guide](https://documentation.libreoffice.org/en/english-documentation/) for an introduction and practive on dispensable documents to get an idea of their possibilities.

I updated my first message and added extra info.

My quistion is:
How can I delete manually numbers without having to delete them one by one?
For example:

  1. This is first paragraph.
  2. This is second paragraph.
  3. This is another paragraph.

Provided your numbered paragraphs are the only numbered items of interest (heading live in a different namespace), you can try the following regular expression:

 \d+\.\t

i.e. a number followed by a dot followed by a Tab. Don’t forget to tick Regular expression checkbox. Find All. Quit the dialog, without deselecting the matches. Apply Numbering 123 list style. Find again your manual numbers, quit the dialog without deselecting and press Del.

2 Likes

@afshin: A reduced example as an .odt file would surely be helpful and might avoid the need of questions in return.
E.g.: For a document with manually created numbering we probably can’t be sure that the number always is at the beginning of a paragraph. (There may be a Tab in front, or we are at the beginning of a line after a hard line break. A RegEx catching the needed cases will depend on such things.
Since “afshin” also seems to be from a region wher writing RTL is preferred, and digits may be Arabic (Eastern) style of the indo-arabic decimal family any answer may be afflicted by related problems anyway.

1 Like

If I want to do this for some of my text, What can I do?

I checked this option (screenshot) but dose not work!

Have you selected the target portion of text before opening Find&Replace?

Yes, if I hadn’t selected, this option (Current selection only) wouldn’t have activated!

What doesn’t work? Have you ticked other options? Which is your search string: a plain string or a regexp?

Did you remember this step in the process?

I mean I want only some part of my document clear the manual numbers and and convert them to autonumber list (Toggle Ordered List)

Yes, I did.

Double check the regular expression: it requires the use of backslash \ to give special meaning to letters and period.

1 Like

Please let me ask other question:

For example:
123. This is a test.
124. This is a test.
125. This is a test.

After numbers there is dot (.) and after dot there is space ( ) and after space there is “This is a test.”

I want to clear numbers and dot after those and spaces after dots.
How can I do?
Thank you.

Regexp to clear spaces or tabs after number: \d+\.[ \t]+


Regular expressions are described in the built-in help Help>LO Help.

2 Likes