search
HomeTopicswordPractical Word skills sharing: quickly and batch delete spaces and empty lines

In the previous article "Practical Word Tips Sharing: How to Batch Clear English in Documents", we introduced the method of batch deleting all English in documents. Today we will continue to talk about Word search and replace techniques, and introduce how to delete spaces and blank lines in batches. Come and take a look!

Practical Word skills sharing: quickly and batch delete spaces and empty lines

In our daily work, we often encounter the following two problems:

For example, there are many plain text materials downloaded from the Internet or copied to Word. , the most annoying thing is that there are a lot of spaces or empty lines (carriage returns) in the document. The format is very confusing and does not meet the typesetting requirements at all, as shown in the picture. If you want to delete them line by line, it will be time-consuming and laborious.

Practical Word skills sharing: quickly and batch delete spaces and empty lines

In order to quickly make the text standardized and tidy, the effect is as shown in the figure.

Practical Word skills sharing: quickly and batch delete spaces and empty lines

Next, let me teach you two tips that will take you just a few seconds to easily delete all spaces and empty lines.

1. Delete spaces in batches

(1) Click [Start]-[Edit]-[Replace] button or press the [Ctrl H] key combination to open the "Find and Replace" dialog box, position the mouse cursor in the "Find What" text box, and then click the "More" button.

(2) Expand the "Replace" column, click the "Special Format" button, and select the "Blank Area" option in the pop-up menu.

(3) Click the "Replace All" button, click the "OK" button in the "All Completed" prompt box, and all spaces will be deleted.

Practical Word skills sharing: quickly and batch delete spaces and empty lines

2. Delete blank lines in batches

In Word, the carriage return character is also called a paragraph mark , a carriage return character indicates the end of a line, so deleting a blank line means deleting redundant carriage returns (paragraph marks). Simply put, it is to replace multiple consecutive carriage returns (paragraph marks) with one carriage return character. Method As follows:

(1) Open the "Find and Replace" dialog box, position the mouse cursor in the "Find What" text box, and then click the "More" button.

(2) Expand the "Replace" column, click the "Special Format" button, and select the "Paragraph Mark" option in the pop-up menu. At this time, you will find that ^p is automatically added to the "Find content" text box. (But it should be noted here that a blank line is formed by multiple consecutive carriage returns (paragraph marks)). Therefore, we need to enter two ^p^p in [Find content] to find two consecutive paragraph marks; and enter 1 ^p in the [Replace with] text box means replacing the found content with a paragraph mark.

(3) Click the "Replace All" button, click the "OK" button in the "All Completed" prompt box, and all blank lines will be deleted.

Practical Word skills sharing: quickly and batch delete spaces and empty lines

Tips: If you enter 1 ^p in "Find content", or the content of "Replace with" is If empty, all carriage returns (paragraph marks) in the document will be deleted and all content will become a paragraph.

On the contrary, if we want to add a blank line, we can reverse the replacement content:

Practical Word skills sharing: quickly and batch delete spaces and empty lines

In addition, if the blank line in the document is not a carriage return style Paragraph mark, but the manual line break of the downward arrow (that is, the blank line formed by pressing the Shift Enter key), as shown in the figure, what should I do?

Practical Word skills sharing: quickly and batch delete spaces and empty lines

For blank lines formed by manual line breaks, you can select the "Manual Line Wrap (L)" option in "Special Characters" twice when replacing, that is, "Find Contents" "Enter 2 "^l^l"; replace it with "^P", and the blank line can be deleted.

Practical Word skills sharing: quickly and batch delete spaces and empty lines

Recommended tutorial: "Word Tutorial"

The above is the detailed content of Practical Word skills sharing: quickly and batch delete spaces and empty lines. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:部落窝教育. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)