Notebook with Microsoft Word logo. Word processor developed by Microsoft.
Image: PhotoGranary/Adobe Stock

Depending on where your Microsoft Word files come from, the content might not be structured in a way that you can use. When that happens, you can spend a lot of time restructuring manually or get the job done in a matter of seconds using Word Replace. This feature makes quick work of a delimited list. In this tutorial, I’ll show you how to use Word’s Replace feature to turn a paragraph of related items into a proper list.

SEE: Windows, Linux, and Mac commands everyone needs to know (free PDF) (TechRepublic)

I’m using Microsoft 365 on a Windows 10 64-bit system, but you can use earlier versions of Word. Word for the web supports Replace. Download the demo files.

How to break down the requirement

The problem sounds a bit more complex than it really is. Figure A shows several fake email addresses. A semicolon separates each address. Used in this manner, the semicolon is a delimiter — a character used to separate items. In such a brief list, we could restructure the data manually, but the content won’t always be a short paragraph.

Figure A

Let’s convert the paragraph of email addresses into a list of single addresses on each line.

The easiest way to restructure this content is to use Word’s Replace feature, which poses the question: What are we looking for and what will replace it?

The content contains a character that we won’t need, the semicolon. To force what follows the semicolon to the next line, we’ll replace the semicolon with a hard return. When you force Word to wrap to the next line at the right margin by pressing Enter, then Word inserts a hard return or paragraph mark.

Now that we have what seems like a reasonable solution, let’s implement it.

How to use Replace to restructure content in Word

What looked like a difficult problem has a simple Replace solution. Let’s implement the Replace as follows:

  1. On the Home tab, click Replace in the Editing group or press Ctrl + H.
  2. Before you do anything else, click More and then No Formatting. If dimmed, you can skip the No Formatting button. Uncheck any other options checked in the Search Options section. Word remembers the last Replace task, so it’s a good idea to always check for settings that might keep your new task from working.
  3. Enter ; into the Find What control — replace any content that’s already there.
  4. Click inside the Replace With control and delete any content already there.
  5. With the cursor still in the Replace With control, click Special in the Replace section at the bottom of the dialog.
  6. Choose Paragraph (Figure B) from the resulting list. Figure C shows a special character code, ^p, that represents a hard page return, or paragraph mark.
  7. Click Replace All and click OK to confirm the replace task.
  8. Click Close.

Figure B

Enter the Find What and Replace With characters.

Figure C

The Replace task replaced each semicolon with a paragraph mark.

Figure D

As you can see in Figure D, the semicolons are gone, and each address is on a line of its own. We restructured the content by replacing the semicolons with paragraph marks. To see the paragraph marks, click Show/Hide in the Paragraph group on the Home tab.

How to work with a different delimiter

The delimiter seems important because that’s what we replaced. However, the delimiter can be almost any character. Let’s try the same list with underscore characters between each address, as shown in Figure E.

Figure E

An underscore can be a delimiter.

Figure F

Repeat the steps above, except in Step 3, enter _, as shown in Figure F. The results will be the same as before (Figure D). Word will replace the space characters with paragraph marks.

If you’re working in a document with other content, the delimiter character might be in use in other areas. When that’s the case, select the delimited content and run the replace task only on that content. That way you don’t accidentally replace characters elsewhere in the document. If you make a mistake, press Ctrl + Z to undo the task so you can try again.

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays