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

Re: Search and replace clip help

Expand Messages
  • plhpr
    Thanks for this but nothing seems to work. I want to change the a and b and c etc in this context below:- First of the Summer Wine - ]Cyril Gerber Fine Art
    Message 1 of 9 , May 20, 2013
    • 0 Attachment
      Thanks for this but nothing seems to work.

      I want to change the a\ and b\ and c\ etc in this context below:-

      First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2 b\
      Fred Cuming RA - ]Adam (Bath)[ - 13 a\

      into this:-
      First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2\
      Fred Cuming RA - ]Adam (Bath)[ - 13\

      I have tried all suggestions. One method worked once and then failed on the next pass and didn't work again.

      ie:
      ^!Replace ' a\' '\' WSTA
      ^!Replace ' b\' '\' WSTA

      Thanks for all help, any ideas.

      PH




      --- In notetab@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
      >
      > --- In notetab@yahoogroups.com, "plhpr" <ph@> wrote:
      > >
      > > Silly but I cannot find out in the help section how to search and replace this simple sequence in quotes below
      > >
      > > ' b\' ie space b backslash
      > >
      > > into a simple '\' backslash.
      > >
      > > I understand that space is represented as '\s' but '\sb\' as a search does not seem to find it.
      >
      >
      > In a RegEx search, you have to escape the backslash because it's interpreted as a metacharacter (see Help --> Help on Regular Expressions --> Characters and Metacharacters). So the pattern is: '\sb\\'. In the replace string, you don't have to escape it.
      >
      > Note that, since NT 5.0, '\s' doesn't match a space (ANSI 32) only but ANSI 9, 10, 12, 13, 32, 133, and 160. If you try to match precisely a space and nothing else then you better enter a space character or make use of hex notation '\x20' or octal notation '\040'.
      >
      > For more about escaping see p. 15 in...
      >
      > http://zmievski.org/files/talks/codeworks-2009/regex-clinic.pdf
      >
      > But do you really have to use RegEx here? In a standard search you could use just literal characters: ' b\' (space, b, backslash).
      >
      > Flo
      >
    • Alex Plantema
      ... The format is wrong. You can use either ^!Replace a WSTA with spaces between the elements, or ^!Replace a WSTA with tabs between
      Message 2 of 9 , May 20, 2013
      • 0 Attachment
        Op maandag 20 mei 2013 12:34 schreef plhpr:

        > Thanks for this but nothing seems to work.
        >
        > I want to change the a\ and b\ and c\ etc in this context below:-
        >
        > First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2 b\
        > Fred Cuming RA - ]Adam (Bath)[ - 13 a\
        >
        > into this:-
        > First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2\
        > Fred Cuming RA - ]Adam (Bath)[ - 13\
        >
        > I have tried all suggestions. One method worked once and then failed
        > on the next pass and didn't work again.
        >
        > ie:
        > ^!Replace ' a\' '\' WSTA
        > ^!Replace ' b\' '\' WSTA

        The format is wrong. You can use either
        ^!Replace " a\" >> "\"' WSTA
        with spaces between the elements, or
        ^!Replace a\ \ WSTA
        with tabs between the elements.

        Alex.
      • John Shotsky
        From your sample, it appears that you want to replace [space][letter][backslash] following a number with just [backslash]. It also appears that this will only
        Message 3 of 9 , May 20, 2013
        • 0 Attachment
          From your sample, it appears that you want to replace [space][letter][backslash] following a number with just [backslash]. It also
          appears that this will only occur on the end of a line. Assuming these are correct, this will do it.
          ^!Replace "\d\K\x20[a-z](?=\\$)" >> "" ARSW

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

          From: notetab@yahoogroups.com [mailto:notetab@yahoogroups.com] On Behalf Of plhpr
          Sent: Monday, May 20, 2013 03:34
          To: notetab@yahoogroups.com
          Subject: [NTB] Re: Search and replace clip help


          Thanks for this but nothing seems to work.

          I want to change the a\ and b\ and c\ etc in this context below:-

          First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2 b\
          Fred Cuming RA - ]Adam (Bath)[ - 13 a\

          into this:-
          First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2\
          Fred Cuming RA - ]Adam (Bath)[ - 13\

          I have tried all suggestions. One method worked once and then failed on the next pass and didn't work again.

          ie:
          ^!Replace ' a\' '\' WSTA
          ^!Replace ' b\' '\' WSTA

          Thanks for all help, any ideas.

          PH

          --- In notetab@yahoogroups.com <mailto:notetab%40yahoogroups.com> , "flo.gehrke" <flo.gehrke@...> wrote:
          >
          > --- In notetab@yahoogroups.com <mailto:notetab%40yahoogroups.com> , "plhpr" <ph@> wrote:
          > >
          > > Silly but I cannot find out in the help section how to search and replace this simple sequence in quotes below
          > >
          > > ' b\' ie space b backslash
          > >
          > > into a simple '\' backslash.
          > >
          > > I understand that space is represented as '\s' but '\sb\' as a search does not seem to find it.
          >
          >
          > In a RegEx search, you have to escape the backslash because it's interpreted as a metacharacter (see Help --> Help on Regular
          Expressions --> Characters and Metacharacters). So the pattern is: '\sb\\'. In the replace string, you don't have to escape it.
          >
          > Note that, since NT 5.0, '\s' doesn't match a space (ANSI 32) only but ANSI 9, 10, 12, 13, 32, 133, and 160. If you try to match
          precisely a space and nothing else then you better enter a space character or make use of hex notation '\x20' or octal notation
          '\040'.
          >
          > For more about escaping see p. 15 in...
          >
          > http://zmievski.org/files/talks/codeworks-2009/regex-clinic.pdf
          >
          > But do you really have to use RegEx here? In a standard search you could use just literal characters: ' b\' (space, b, backslash).
          >
          > Flo
          >



          [Non-text portions of this message have been removed]
        • hsavage
          ... on the next pass and didn t work again. ... ph, These commands work pretty well; as a group: ^!Replace ^%space%a TWSA ^!Replace ^%space%b
          Message 4 of 9 , May 20, 2013
          • 0 Attachment
            On 5/20/2013 5:34 AM, plhpr wrote:
            > Thanks for this but nothing seems to work.
            >
            > I want to change the a\ and b\ and c\ etc in this context below:-
            >
            > First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2 b\
            > Fred Cuming RA - ]Adam (Bath)[ - 13 a\
            >
            > into this:-
            > First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2\
            > Fred Cuming RA - ]Adam (Bath)[ - 13\
            >
            > I have tried all suggestions. One method worked once and then failed
            on the next pass and didn't work again.
            >
            > ie:
            > ^!Replace ' a\' '\' WSTA
            > ^!Replace ' b\' '\' WSTA
            >
            > Thanks for all help, any ideas.
            >
            > PH

            ph,

            These commands work pretty well;

            as a group:
            ^!Replace "^%space%a\" >> "\" TWSA
            ^!Replace "^%space%b\" >> "\" TWSA
            ^!Replace "^%space%c\" >> "\" TWSA
            ^!Replace "^%space%d\" >> "\" TWSA

            individually:
            ^!Replace "\ [a-z]\\$" >> "\" WRSA

            ^!Replace "(\ a\\)|(\ b\\)|(\ c\\)|(\ d\\)$" >> "\" WRSA


            ···············································
            ¤• JD#.140 - ¤• SL.1639/@12>24 - 13.05.20~11.57.25

            • World's Shortest Books
            • Dr. Kevorkian's Collection Of Motivational Speeches

            € hrs € hsavage € pobox € com
          • flo.gehrke
            ... No surprise! This was meant for use with the Search | Replace command since - so far - you didn t talk of a clip. Also you are posting to the Basic Group
            Message 5 of 9 , May 20, 2013
            • 0 Attachment
              --- In notetab@yahoogroups.com, "plhpr" <ph@...> wrote:
              >
              > Thanks for this but nothing seems to work.

              No surprise! This was meant for use with the 'Search | Replace' command since - so far - you didn't talk of a clip. Also you are posting to the Basic Group and not to the Clip Group.

              So if you try do it by clip, try a non-Regex-solution...

              ^!Replace " a\" >> "\" WSA
              ^!Replace " b\" >> "\" WSA

              No 'T' option needed here. NT will match it anyway because the search string is containing word-delimiting characters.

              Maybe John's proposal is more exact since it anchors the string at end of line. So you may use that pattern in case it accords with the structure of your text.

              Flo
            • plhpr
              Many thanks to all - it works now.
              Message 6 of 9 , May 22, 2013
              • 0 Attachment
                Many thanks to all - it works now.

                --- In notetab@yahoogroups.com, "Alex Plantema" <alex.plantema@...> wrote:
                >
                > Op maandag 20 mei 2013 12:34 schreef plhpr:
                >
                > > Thanks for this but nothing seems to work.
                > >
                > > I want to change the a\ and b\ and c\ etc in this context below:-
                > >
                > > First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2 b\
                > > Fred Cuming RA - ]Adam (Bath)[ - 13 a\
                > >
                > > into this:-
                > > First of the Summer Wine - ]Cyril Gerber Fine Art & Compass[ - 2\
                > > Fred Cuming RA - ]Adam (Bath)[ - 13\
                > >
                > > I have tried all suggestions. One method worked once and then failed
                > > on the next pass and didn't work again.
                > >
                > > ie:
                > > ^!Replace ' a\' '\' WSTA
                > > ^!Replace ' b\' '\' WSTA
                >
                > The format is wrong. You can use either
                > ^!Replace " a\" >> "\"' WSTA
                > with spaces between the elements, or
                > ^!Replace a\ \ WSTA
                > with tabs between the elements.
                >
                > Alex.
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.