Loading ...
Sorry, an error occurred while loading the content.

24308RE: [Clip] Re: cleaning extra spaces

Expand Messages
  • John Shotsky
    Jan 18, 2014

      Your example doesn't work because \s INCLUDES line endings.

      To replace all kinds of line endings with a Windows one you would replace \R with \r\n.

      But \s includes all whitespace - spaces, tabs line endings, etc.

      To do what you want requires treating spaces separately from line ends, because you want to force the situation where line ends occur, not just whitespace.

      I can't exactly explain why your text runs together, but you might want to run a clip before the ones I've shown to make all line ends Windows CRLF. (\r\n as shown above) Do that first to make Windows line ends, then run what I've provided, and then all line ends should display as expected. In Html, your line ends could come from Windows, Mac or *nix, each of which treats line ends differently, and browsers obey them all. All my clips standardize line ends as a first step, and usually the same with non-break spaces. I have seen odd behavior in NoteTab when the full CRLF was not present.

      Regards,
      John
      RecipeTools Web Site: http://recipetools.gotdns.com/
      John's Mags Yahoo Group:  http://groups.yahoo.com/group/johnsmags/

       

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of peterhulm@...
      Sent: Saturday, January 18, 2014 14:12
      To: ntb-clips@yahoogroups.com
      Subject: RE: [Clip] Re: cleaning extra spaces

       

       

      Thanks again John for taking time to explain. In NoteTab when I run your clip all the lines cascade together
      <!DOCTYPE html> <html lang="en"> <head> <!--google fonts--> <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Domine:400,700|Nobile:400,400italic,700italic,700"> <meta charset="utf-8"> <title>Postmodern studies: House of Cards</title>

       but when I paste them here they are reformatted, as:

      <!DOCTYPE html>
       <html lang="en">
       <head>
       <!--google fonts-->
       <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Domine:400,700|Nobile:400,400italic,700italic,700">
       <meta charset="utf-8">
       <title>Postmodern studies: House of Cards</title>

      Maybe I have something configured wrong in NoteTab's settings.

      I still can't explain to myself why the old clip does not work, i.e.
      ^!Replace "\s\R\s">>"\R" RW (replacing the old \r with \R.

      I'm hoping you have an explanation for that too.

    • Show all 17 messages in this topic