Jump to content

Wikipedia:Reference desk/Archives/Computing/2021 May 24

From Wikipedia, the free encyclopedia
Computing desk
< May 23 << Apr | May | Jun >> May 25 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


May 24[edit]

How to delete blank lines in MS word?[edit]

I don't know the length of blank lines in my text document. I don't have a time to trim those lines. I following this one here , but not find correct solution to trim blank spaces after each line. Problem arises when I copy text from notepad to word. It gives me huge blank lines after text. Rizosome (talk) 07:34, 24 May 2021 (UTC)[reply]

Hi Rizosome. If you mean excess spaces at the end of a paragraph you can see these by clicking the ¶ icon. They appear as dots. Search and replace every instance of a space followed by a paragraph break with just a paragraph break. A paragraph break is emulated by ^p in the search box. It might be quicker to first search and replace all multiple spaces with a single space. You might have to do that several times to get rid of them all.--Shantavira|feed me 08:26, 24 May 2021 (UTC)[reply]
If there are really long sequences of space characters, you can start by replacing groups of eight by a single space, and then groups of four, before replacing double spaces.  --Lambiam 11:33, 25 May 2021 (UTC)[reply]
By 'eck, that's old school. I can remember working that one out using EDT on VAXes, so must be 35 years ago! It's still good advice though. Martin of Sheffield (talk) 12:59, 25 May 2021 (UTC)[reply]

@Lambiam:groups of eight?? means? Rizosome (talk) 15:10, 25 May 2021 (UTC)[reply]

That's a trick I use also. Replace 8 spaces by a single space, repeatedly until there are no more groups of 8 spaces. Then do likewise with 7, 6, 5, 4, 3 and 2. Or instead of 8, start with the largest number that you think might be in the text, and count down from there. ←Baseball Bugs What's up, Doc? carrots→ 15:22, 25 May 2021 (UTC)[reply]
I think that on the average going 8*–4–2 (where * means: repeat until no change) is faster than 8*–7–6–5–4–3–2.  --Lambiam 17:24, 25 May 2021 (UTC)[reply]
Probably so. But the * applies to all levels. ←Baseball Bugs What's up, Doc? carrots→ 18:39, 25 May 2021 (UTC)[reply]
I'm assuming a "Replace All" function.  --Lambiam 10:18, 26 May 2021 (UTC)[reply]
Remember to use "^ " and " $" so that you only trim. Probably not an issue with 8 spaces, but you wouldn't want to start deleting single and double spaces mid line. Martin of Sheffield (talk) 10:24, 26 May 2021 (UTC)[reply]