locked
removing extra spaces between words in a paragraph RRS feed

  • Question

  • hi friends

    imagine we have a paragraph which contains 4 lines. in this lines, there are some extra spaces between some words ( instead of standard one space between each words).

    is there any solution so that we select the entire paragraph & then click on something so that it removes extra spaces between that words & makes one space between all words?

    for example we have following undesirable paragraph:

    A terminating error    stops a statement from running. If Windows PowerShell does not handle a terminating error    in some way, Windows PowerShell also      stops running the function or script using the current pipeline. In other      languages, such as C#, terminating errors are referred to as exceptions.      For more information about errors, see about_Errors. 

    which we want to become as following:

     A terminating error stops a statement from running. If Windows PowerShell does not handle a terminating error in some way, Windows PowerShell also stops running the function or script using the current pipeline. In other languages, such as C#, terminating errors are referred to as exceptions. For more information about errors, see about_Errors. 

    thanks in advanced

    Tuesday, March 31, 2015 9:23 PM

Answers

  • Forget about the "(between Alphabet or not)" part.

    For you, for now, "Multiple spaces" is good enough.

    .

    At "Find and Replace" window (using Ctrl h short key),

    At "find" edit field, put multiple spaces (let's say two/double spaces), and,

    At "replace" edit field, put single space, and Click.

    .

    That is it.

    .

    Good Luck !


    Wednesday, April 1, 2015 10:51 AM

All replies

  • How about to use "Find and Replace" function ?

    It has lots of nice wildcards/special codes options too.

    Find "multiple spaces(between Alpabet or not)" and replace with "single sapce".

    • Marked as answer by john.s2011 Wednesday, April 1, 2015 6:37 AM
    • Unmarked as answer by john.s2011 Wednesday, April 1, 2015 6:37 AM
    Wednesday, April 1, 2015 12:22 AM
  • hi thanks for help.

    i solved my problem using your guide. but there is not a such thing:

    Find "multiple spaces(between Alpabet or not)" .

    may you please put an screenshot of yours here:

    • Edited by john.s2011 Wednesday, April 1, 2015 6:37 AM
    Wednesday, April 1, 2015 6:36 AM
  • Forget about the "(between Alphabet or not)" part.

    For you, for now, "Multiple spaces" is good enough.

    .

    At "Find and Replace" window (using Ctrl h short key),

    At "find" edit field, put multiple spaces (let's say two/double spaces), and,

    At "replace" edit field, put single space, and Click.

    .

    That is it.

    .

    Good Luck !


    Wednesday, April 1, 2015 10:51 AM
  • And repeat the Replace All until no instances are found.

    For the wildcards see Replace using wildcards.


    Charles Kenyon Madison, WI

    Wednesday, April 1, 2015 11:44 AM
  • thanks to both,  but your solution works about specific number of spaces. 

    if we want any number of white spaces (two or more) be replaced with one white space, that would be:

    find: ( ){2,} 

    replace with: \1

    Wednesday, April 1, 2015 9:55 PM
  • For you, for now

    .

    empty{2,}

    empty

    .

    should be good enough.

    Wednesday, April 1, 2015 10:33 PM