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!
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.
In order to quickly make the text standardized and tidy, the effect is as shown in the figure.
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.
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.
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:
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?
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.
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!