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

Twos and Threes

Expand Messages
  • Adrian Worsfold
    Hello once again I know why this isn t working, because from 10 above 2 lines need to merge, and from 1 to 9 three lines need to merge. This does 3 lines:
    Message 1 of 10 , May 24 9:15 PM
      Hello once again

      I know why this isn't working, because from 10 above 2 lines need to merge, and from 1 to 9 three lines need to merge.

      This does 3 lines:

      ^!Replace "^(\d+)\R(.+)\R(\d.*:.*)$" >> "$1 $2 $3" ARSW

      What does two lines? (I have been grappling with this and trying random guesses)

      Both need to run at the same time. Raw material follows:

      1
      Prinknash Stanbrook Abbeys Monks Nuns Abbey Bells Introit
      00:02:00
      2
      RudorffErnst KerseyJohn Impromptu op. 51
      00:03:52
      3
      FranckEduard KerseyJohn Klavierstuck op 62 no 6
      00:05:57
      4
      SmithSydney KerseyJohn Aspiration melodie op 208 no 1
      00:04:14
      5
      AshtonAlgernon KerseyJohn Toccata op 127 no 4
      00:02:17
      6
      WolfHugo RegerMax KerseyJohn Begegnung
      00:02:03
      7
      HL 126 Stenka Razin choir
      00:01:40.1
      8
      SF 064 Wentworth choir
      00:01:37.0
      9
      ReussHeinrich KerseyJohn Andante in G minor
      00:05:04
      10 SF 060 This Old Man choir piano
      00:01:51
      11 KopylovAlexander KerseyJohn Feuille d'album in C
      00:01:54
      12 SF 030 Middleton choir
      00:02:27.0
      13 Rosenhain KerseyJohn Romance op 14 no 4
      00:03:01
      14 ScholtzHerrmann KerseyJohn Albumblatt op 20 no 3
      00:02:54
      15 RudorffErnst KerseyJohn Capriccio appassionato, op 48
      00:05:14
      16 Birtwistle Triumph of Time
      00:29:32


      Thanks in advance

      Adrian Worsfold

      http://www.pluralist.co.uk
      http://pluralistspeaks.blogspot.com
      pluralist@...
      25-05-2013
      ----- Received the following content -----
      From: flo.gehrke
      Receiver: ntb-clips
      Time: 2013-05-24, 23:03:23
      Subject: [Clip] Re: Adding a second when there's a tenth or more


      [Non-text portions of this message have been removed]
    • Axel Berger
      ... Make that: ^!Replace ^( d+)( | R)(.+) R( d.*:.*)$ $1 $3 $3 ARSW I m just packing to be off for a week so this is my last post in this thread. Hope
      Message 2 of 10 , May 25 1:16 AM
        Adrian Worsfold wrote:
        > ^!Replace "^(\d+)\R(.+)\R(\d.*:.*)$" >> "$1 $2 $3" ARSW

        Make that:

        ^!Replace "^(\d+)( |\R)(.+)\R(\d.*:.*)$" >> "$1 $3 $3" ARSW

        I'm just packing to be off for a week so this is my last post in this
        thread. Hope it works and there aren't any unintended consequences.

        Axel
      • Adrian Worsfold
        Hello Axel Berger Very grateful for the assistance regardless of consequences intended or unintended! I have been working out a logical path and the coding to
        Message 3 of 10 , May 25 6:36 AM
          Hello Axel Berger


          Very grateful for the assistance regardless of consequences intended or unintended!

          I have been working out a logical path and the coding to break up two lines into three, to then use the existing line, all the time 'knowing' that the other method would be available but beyond my understanding.





          Adrian Worsfold

          http://www.pluralist.co.uk
          http://pluralistspeaks.blogspot.com
          pluralist@...
          25-05-2013
          ----- Received the following content -----
          From: Axel Berger
          Receiver: ntb-clips
          Time: 2013-05-25, 09:16:58
          Subject: Re: [Clip] Twos and Threes


          [Non-text portions of this message have been removed]
        • flo.gehrke
          ... Adrian, I ve combined three tasks that we have discussed so far in one clip. Maybe I misunderstood the concept as a whole -- but anyway you may want to
          Message 4 of 10 , May 25 6:50 AM
            --- In ntb-clips@yahoogroups.com, "Adrian Worsfold"<pluralist@...> wrote:
            >
            > Hello once again
            >
            > I know why this isn't working, because from 10 above 2 lines need to merge, and from 1 to 9 three lines need to merge...

            Adrian,

            I've combined three tasks that we have discussed so far in one clip. Maybe I misunderstood the concept as a whole -- but anyway you may want to give it a try.

            I took the new list you posted today. There are some new features in that list. e.g. '00' standing for zero hours and '.0' decimals. So I adapted the clip to that. I also changed some time data in order to see all possible types, and I inserted some surplus space to get removed by the clip.

            Another proposal: Wouldn't it make sense to distinguish between decimals from 0 through 4 and above? For example, '09:10.01' is closer to '09:10' than to '09:11'. I included that consideration in the clip below.

            New test list - before:

            1
            Prinknash Stanbrook Abbeys Monks Nuns Abbey Bells Introit
            00:01:58.4
            2
            RudorffErnst KerseyJohn Impromptu op. 51
            00:12:59.0
            3
            FranckEduard KerseyJohn Klavierstuck op 62 no 6
            00:03:59.9
            4
            SmithSydney KerseyJohn Aspiration melodie op 208 no 1
            00:11:00.0
            5
            AshtonAlgernon KerseyJohn Toccata op 127 no 4
            00:15:59.5
            6
            WolfHugo RegerMax KerseyJohn Begegnung
            00:02:03
            7
            HL 126 Stenka Razin choir
            00:10:00.1
            8
            SF 064 Wentworth choir
            00:10:09.1
            9
            ReussHeinrich KerseyJohn Andante in G minor
            00:10:01.3
            10 SF 060 This Old Man choir piano
            00:12:10.4
            11 KopylovAlexander KerseyJohn Feuille d'album in C
            00:07:03.3
            12 SF 030 Middleton choir
            00:02:27.0
            13 Rosenhain KerseyJohn Romance op 14 no 4
            00:01:37.0
            14 ScholtzHerrmann KerseyJohn Albumblatt op 20 no 3
            00:12:59.0
            15 RudorffErnst KerseyJohn Capriccio appassionato, op 48
            00:05:14
            16 Birtwistle Triumph of Time
            00:29:32


            New test list - after processing with the clip below...


            1 Prinknash Stanbrook Abbeys Monks Nuns Abbey Bells Introit [01:58]
            2 RudorffErnst KerseyJohn Impromptu op. 51 [12:59]
            3 FranckEduard KerseyJohn Klavierstuck op 62 no 6 [04:00]
            4 SmithSydney KerseyJohn Aspiration melodie op 208 no 1 [11:00]
            5 AshtonAlgernon KerseyJohn Toccata op 127 no 4 [16:00]
            6 WolfHugo RegerMax KerseyJohn Begegnung [02:03]
            7 HL 126 Stenka Razin choir [10:00]
            8 SF 064 Wentworth choir [10:09]
            9 ReussHeinrich KerseyJohn Andante in G minor [10:01]
            10 SF 060 This Old Man choir piano [12:10]
            11 KopylovAlexander KerseyJohn Feuille d'album in C [07:03]
            12 SF 030 Middleton choir [02:27]
            13 Rosenhain KerseyJohn Romance op 14 no 4 [01:37]
            14 ScholtzHerrmann KerseyJohn Albumblatt op 20 no 3 [12:59]
            15 RudorffErnst KerseyJohn Capriccio appassionato, op 48 [05:14]
            16 Birtwistle Triumph of Time [29:32]


            If that gets close to what you try to achieve then you may try...


            ^!SetHintInfo Working...
            ^!SetScreenUpdate Off
            ; Remove spaces at start or end of lines
            ^!Replace "^\x20+|\x20+$" >> "" WARS
            ; Make new line break
            ^!Replace "\R(?![1-9])" >> "\x20" WARS
            ; Remove new space at EOF
            ^!Replace "\x20+\Z" >> "" WRS
            ; Remove decimal seconds from 0 through 4
            ^!Replace "\.[0-4]{1,}$" >> "" WARS
            ^!Jump Doc_Start
            :Seconds
            ^!Find "(\d\d)\.\d$" RS
            ^!IfError Skip_2
            ^!InsertText "^$Calc(^$GetReSubstrings$+1)$"
            ^!Goto Seconds
            ^!Jump Doc_Start
            :Minutes_1
            ^!Find "([0][1-8]):60$" RS
            ^!IfError Skip_2
            ^!InsertText "0^$Calc(^$GetReSubStrings$+1)$:00"
            ^!Goto Minutes_1
            ^!Jump Doc_Start
            :Minutes_2
            ^!Find "([0][1-9]):60$" RS
            ^!IfError Skip_2
            ^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
            ^!Goto Minutes_2
            ^!Jump Doc_Start
            :Minutes_3
            ^!Jump Doc_Start
            ^!Find "(\d\d):60$" RS
            ^!IfError Out
            ^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
            ^!Goto Minutes_3
            :Out
            ^!Replace ":\K(?=\d$)" >> "0" WARS
            ; Embrace time with square brackets / Remove '00' hours
            ^!Replace "00:(\d\d:\d\d)$" >> "[$1]" WARS
            ^!Jump 1

            Regards,
            Flo
          • Adrian Worsfold
            Hello all ^!Replace ^( d+)( | R)(.+) R( d.*:.*)$ $1 $3 $3 ARSW does not work, even with the second $ replaced to 2. It is still partial regarding the
            Message 5 of 10 , May 25 6:56 AM
              Hello all

              ^!Replace "^(\d+)( |\R)(.+)\R(\d.*:.*)$" >> "$1 $3 $3" ARSW

              does not work, even with the second $ replaced to 2. It is still partial regarding the lines and loses the timings at the end.

              I'll plod on. My solution would be to insert a line after all numbers starting with 10 and then use the original regex offering:

              ^!Replace "^(\d+)\R(.+)\R(\d.*:.*)$" >> "$1 $2 $3" ARSW


              Try it on (the .PDF output as copied):

              1
              Prinknash Stanbrook Abbeys Monks Nuns Abbey Bells Introit
              00:02:00
              2
              RudorffErnst KerseyJohn Impromptu op. 51
              00:03:52
              3
              FranckEduard KerseyJohn Klavierstuck op 62 no 6
              00:05:57
              4
              SmithSydney KerseyJohn Aspiration melodie op 208 no 1
              00:04:14
              5
              AshtonAlgernon KerseyJohn Toccata op 127 no 4
              00:02:17
              6
              WolfHugo RegerMax KerseyJohn Begegnung
              00:02:03
              7
              HL 126 Stenka Razin choir
              00:01:40.1
              8
              SF 064 Wentworth choir
              00:01:37.0
              9
              ReussHeinrich KerseyJohn Andante in G minor
              00:05:04
              10 SF 060 This Old Man choir piano
              00:01:51
              11 KopylovAlexander KerseyJohn Feuille d'album in C
              00:01:54
              12 SF 030 Middleton choir
              00:02:27.0
              13 Rosenhain KerseyJohn Romance op 14 no 4
              00:03:01
              14 ScholtzHerrmann KerseyJohn Albumblatt op 20 no 3
              00:02:54
              15 RudorffErnst KerseyJohn Capriccio appassionato, op 48
              00:05:14
              16 Birtwistle Triumph of Time
              00:29:32




              Adrian Worsfold

              http://www.pluralist.co.uk
              http://pluralistspeaks.blogspot.com
              pluralist@...
              25-05-2013
              ----- Received the following content -----
              From: Axel Berger
              Receiver: ntb-clips
              Time: 2013-05-25, 09:16:58
              Subject: Re: [Clip] Twos and Threes


              [Non-text portions of this message have been removed]
            • Adrian Worsfold
              Hello Flo Many thanks but (for explanation) in a CD timing a .1 is more than the time with minutes and seconds only, so it always adds a second, never loses
              Message 6 of 10 , May 25 8:54 AM
                Hello Flo

                Many thanks but (for explanation) in a CD timing a .1 is more than the time with minutes and seconds only, so it always adds a second, never loses time. I've taken that loss bit out and the rest works very well.

                If only I could work out how! I'm most grateful.

                Here is the complete clip I now use.

                ^!ClearVariables
                ^!Toolbar New Document
                ^!Set %Preacher%=^?[Click on the Service Taker's name=_Adrian Worsfold|Barry Cundill|Bernard McHugh|Chris Pilkington|David Arthur|Elizabeth Faiers|Ernest Baker|Jim Timiney|John Midgley|John Williams|June Pettitt|Keith Brown|Marion Baker|Mavis Lake|Michael Tracey|Rosemary Arthur|Stephanie Cage|Stephen Carlile]
                ^!Info [L]"Print the CD Cover to PDF and copy the tracks.^PAlso note the total time of tracks before the first hymn^P(wipe out first hymn onward - do not save!)."
                ^!ShellWait "C:\Program Files\CDBurnerXP\cdbxpp.exe"
                ^!SetScreenUpdate Off
                ^!InsertHTML ^P^P

                ^!Set %Date%=^$GetDateFromInt(^$Calc(CEIL((^$GetDateToInt$+6)/7)*7-6)$;yyyymmdd)$
                ^!Set %Filename%="Service ^%Date%"
                ^!Toolbar New Document
                ^!Set %Trackslist1%=^$Getclipboard$
                ^!InsertText ^%Trackslist1%
                ^!Jump Doc_Start
                ^!SetHintInfo Working...
                ^!SetScreenUpdate Off
                ; Remove spaces at start or end of lines
                ^!Replace "^\x20+|\x20+$" >> "" WARS
                ; Make new line break
                ^!Replace "\R(?![1-9])" >> "\x20" WARS
                ; Remove new space at EOF
                ^!Replace "\x20+\Z" >> "" WRS
                ^!Jump Doc_Start
                :Seconds
                ^!Find "(\d\d)\.\d$" RS
                ^!IfError Skip_2
                ^!InsertText "^$Calc(^$GetReSubstrings$+1)$"
                ^!Goto Seconds
                ^!Jump Doc_Start
                :Minutes_1
                ^!Find "([0][1-8]):60$" RS
                ^!IfError Skip_2
                ^!InsertText "0^$Calc(^$GetReSubStrings$+1)$:00"
                ^!Goto Minutes_1
                ^!Jump Doc_Start
                :Minutes_2
                ^!Find "([0][1-9]):60$" RS
                ^!IfError Skip_2
                ^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
                ^!Goto Minutes_2
                ^!Jump Doc_Start
                :Minutes_3
                ^!Jump Doc_Start
                ^!Find "(\d\d):60$" RS
                ^!IfError Out
                ^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
                ^!Goto Minutes_3
                :Out
                ^!Replace ":\K(?=\d$)" >> "0" WARS
                ; Embrace time with square brackets / Remove '00' hours
                ^!Replace "00:(\d\d:\d\d)$" >> "[$1]" WARS
                ^!Jump 1

                ^!Clip "Sorting numbers zeros"
                ^!Select All
                ^!Set %Trackslist2%=^$GetSelection$

                ^!DestroyDoc
                ^!FocusDoc
                ;Removes last lines if blank
                ^!Replace "\R{1,}\Z" >> "" WRS

                ^!Jump Doc_Start
                ^!Set %Minutes%=^?{Minutes Long (two digits)=20}
                ^!Set %Seconds%=^?{Seconds Long (two digits)=00}
                ^!Set %Minsclock%=^$Calc(60-^%Minutes%)$

                ^!InsertText "^P^PService ^%Date%^P^P^%Preacher%^P^P^P<Start 10:^%Minsclock% for 11:00 start [^%Minutes%:^%Seconds%]>^P^P"
                ^!InsertText ^%Trackslist2%
                ^!Save As "C:\Shared Documents\Music\^%Filename%.txt"

                The clip for adding zeros - "Sorting numbers zeros" - functions fully and is this:

                ^!SetHintInfo Working...
                ^!SetScreenUpdate Off
                ^!Set %dig%=2
                ^!Find "^\d{^%dig%}" WRS
                ^!IfError Skip_2
                ^!Inc %dig%
                ^!Goto Skip_-3
                ^!Dec %dig%
                ^!Set %q%=^$Calc(^%dig%-1)$
                ^!Replace "^" >> "^$StrFill(\x30;^%dig%)$" WARS
                ^!Replace "^\x30+?(.{^%q%}\d\b)" >> "$1" WARS
                ^!Select All
                ^$StrSort("^$GetSelection$";0;1;0)$

                So this is what happens. There are preset choices for preachers to select, timings for the service to begin (at the first hymn; the seconds don't count - it helps to start slightly late anyway), the document gets dated and saved for the Sunday's date, and the list is made neat, as derived from the CD cover printed to PDF from its raw 3 lines to track 9 and 2 lines to track 10 when examined as text.

                * There is one final potential clip that hardly saves on human viewing, but one may as well push it to the logical end.

                After the number, the presence of HL nnn, SF nnn, LS nn, CC nn, HW nnn, HF nnn, or NB nn indicates a hymn book (or latter no book still with numbers up to 99). Before each hymn book, and after it but not before another hymn book, there is a blank line inserted. This is to tell me to use a second CD made at a higher level of volume which people sing against. Now I am sure this is within my abilities, eventually, the complication being not wanting a blank line in between two hymns indicated by either leading code after the number.

                This final clip would produce (including the effect of the clips above):


                Service 20130526

                David Arthur

                <Start 10:40 for 11:00 start [20:33]>

                01 Prinknash Stanbrook Abbeys Monks Nuns Abbey Bells Introit [02:00]
                02 RudorffErnst KerseyJohn Impromptu op. 51 [03:52]
                03 FranckEduard KerseyJohn Klavierstuck op 62 no 6 [05:57]
                04 SmithSydney KerseyJohn Aspiration melodie op 208 no 1 [04:14]
                05 AshtonAlgernon KerseyJohn Toccata op 127 no 4 [02:17]
                06 WolfHugo RegerMax KerseyJohn Begegnung [02:03]

                07 HL 126 Stenka Razin choir [01:41]
                08 SF 064 Wentworth choir [01:38]

                09 ReussHeinrich KerseyJohn Andante in G minor [05:04]

                10 SF 060 This Old Man choir piano [01:51]

                11 KopylovAlexander KerseyJohn Feuille d'album in C [01:54]

                12 SF 030 Middleton choir [02:28]

                13 Rosenhain KerseyJohn Romance op 14 no 4 [03:01]
                14 ScholtzHerrmann KerseyJohn Albumblatt op 20 no 3 [02:54]
                15 RudorffErnst KerseyJohn Capriccio appassionato, op 48 [05:14]
                16 Birtwistle Triumph of Time [29:32]




                Adrian Worsfold

                http://www.pluralist.co.uk
                http://pluralistspeaks.blogspot.com
                pluralist@...
                25-05-2013
                ----- Received the following content -----
                From: flo.gehrke
                Receiver: ntb-clips
                Time: 2013-05-25, 14:50:10
                Subject: [Clip] Re: Twos and Threes


                [Non-text portions of this message have been removed]
              • flo.gehrke
                ... Adrian, I took the latest list and inserted some hymns at different positions in order to get all possible conditions... 0 CC Any Hymn A [10:30] 1
                Message 7 of 10 , May 26 5:21 AM
                  --- In ntb-clips@yahoogroups.com, "Adrian Worsfold"<pluralist@...> wrote:
                  >
                  > After the number, the presence of HL nnn, SF nnn, LS nn,
                  > CC nn, HW nnn, HF nnn, or NB nn indicates a hymn book (...).
                  > Before each hymn book, and after it but not before another
                  > hymn book, there is a blank line inserted. (...) the complication
                  > being not wanting a blank line in between two hymns

                  Adrian,

                  I took the latest list and inserted some hymns at different positions in order to get all possible conditions...


                  0 CC Any Hymn A [10:30]
                  1 Prinknash Stanbrook Abbeys Monks Nuns Abbey Bells Introit [01:58]
                  2 RudorffErnst KerseyJohn Impromptu op. 51 [12:59]
                  3 FranckEduard KerseyJohn Klavierstuck op 62 no 6 [04:00]
                  4 SmithSydney KerseyJohn Aspiration melodie op 208 no 1 [11:00]
                  5 AshtonAlgernon KerseyJohn Toccata op 127 no 4 [16:00]
                  6 WolfHugo RegerMax KerseyJohn Begegnung [02:03]
                  7 HL 126 Stenka Razin choir [10:00]
                  8 SF 064 Wentworth choir [10:09]
                  9 ReussHeinrich KerseyJohn Andante in G minor [10:01]
                  10 SF 060 This Old Man choir piano [12:10]
                  11 KopylovAlexander KerseyJohn Feuille d'album in C [07:03]
                  12 SF 030 Middleton choir [02:27]
                  13 Rosenhain KerseyJohn Romance op 14 no 4 [01:37]
                  14 ScholtzHerrmann KerseyJohn Albumblatt op 20 no 3 [12:59]
                  XX LS Any hymn B [05:12]
                  XX HF Any hymn C [11:10]
                  XX HW Any hymn D [04:20]
                  15 RudorffErnst KerseyJohn Capriccio appassionato, op 48 [05:14]
                  16 Birtwistle Triumph of Time [29:32]
                  XX LS Any hymn E [07:12]


                  Now try the following clip against that list:


                  ^!Replace "^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$" >> "\r\n$0\r\n" WARS
                  ^!Replace "\R{3}" >> "\r\n" WARS
                  ^!Replace "^\A\R|\R{1,}\Z" >> "" WARS


                  For me, the result is...

                  0 CC Any Hymn [10:30]

                  1 Prinknash Stanbrook Abbeys Monks Nuns Abbey Bells Introit [01:58]
                  2 RudorffErnst KerseyJohn Impromptu op. 51 [12:59]
                  3 FranckEduard KerseyJohn Klavierstuck op 62 no 6 [04:00]
                  4 SmithSydney KerseyJohn Aspiration melodie op 208 no 1 [11:00]
                  5 AshtonAlgernon KerseyJohn Toccata op 127 no 4 [16:00]
                  6 WolfHugo RegerMax KerseyJohn Begegnung [02:03]

                  7 HL 126 Stenka Razin choir [10:00]
                  8 SF 064 Wentworth choir [10:09]

                  9 ReussHeinrich KerseyJohn Andante in G minor [10:01]

                  10 SF 060 This Old Man choir piano [12:10]

                  11 KopylovAlexander KerseyJohn Feuille d'album in C [07:03]

                  12 SF 030 Middleton choir [02:27]

                  13 Rosenhain KerseyJohn Romance op 14 no 4 [01:37]
                  14 ScholtzHerrmann KerseyJohn Albumblatt op 20 no 3 [12:59]

                  XX LS Any hymn [07:12]
                  XX HF Any hymn [07:12]
                  XX HW Any hymn [07:12]

                  15 RudorffErnst KerseyJohn Capriccio appassionato, op 48 [05:14]
                  16 Birtwistle Triumph of Time [29:32]

                  XX LS Any hymn [07:12]

                  Does this match your intention?

                  Regards,
                  Flo
                • Adrian Worsfold
                  Hello Flo This is incredible: indeed yes it is what is wanted. ^!Replace ^.* b(HL|SF|LS|CC|HW|HF|NB) b.*$ r n$0 r n WARS ^!Replace R{3} r n
                  Message 8 of 10 , May 26 9:34 AM
                    Hello Flo

                    This is incredible: indeed yes it is what is wanted.

                    ^!Replace "^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$" >> "\r\n$0\r\n" WARS
                    ^!Replace "\R{3}" >> "\r\n" WARS
                    ^!Replace "^\A\R|\R{1,}\Z" >> "" WARS


                    How do you actually explain such lines? The point about code with loops and all that is you go down the list and follow the logic, once you've pulled hair out via the Help pages ( "Grr, give an example of how you write it!" is what I say there) or seen how other clips do it and got the code lines to work. Often the practical way is clips that follow menus and those keyboard macros that are somewhat sluggish and unreliable.

                    I've looked at the regex pages and notions such as "greedy" mean nothing to me.

                    Once again many thanks are due.



                    Adrian Worsfold

                    http://www.pluralist.co.uk
                    http://pluralistspeaks.blogspot.com
                    pluralist@...
                    26-05-2013
                    ----- Received the following content -----
                    From: flo.gehrke
                    Receiver: ntb-clips
                    Time: 2013-05-26, 13:21:33
                    Subject: [Clip] Re: Twos and Threes


                    [Non-text portions of this message have been removed]
                  • flo.gehrke
                    ... How do you actually explain such lines? Adrian, Let me just give you an explanation for the first command line: Find ^.* b(HL|SF|LS|CC|HW|HF|NB) b.*$ ...
                    Message 9 of 10 , May 26 11:40 AM
                      --- In ntb-clips@yahoogroups.com, "Adrian Worsfold"<pluralist@...> wrote:
                      >
                      > ^!Replace "^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$" >> "\r\n$0\r\n" WARS
                      > etc...

                      How do you actually explain such lines?

                      Adrian,

                      Let me just give you an explanation for the first command line:

                      Find '^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$'...
                      ^ = start of line
                      .* = any character (except NL), zero or more times
                      \b = word boundary (between word character and non-word character)
                      (HL|...|NB) = alternation (a OR b OR c etc)
                      \b = another word boundary
                      .* = again any character till...
                      $ = end of line

                      And replace with...
                      \r\n = CRNL
                      $0 = the whole match
                      \r\n = another CRNL

                      From a stricter point of view, one would write:

                      ^.+?\b(?:HL|SF|LS|CC|HW|HF|NB)\b.+$

                      This is a bit more efficient though, with a few lines, one would hardly notice the difference. At the start of each line, we see at least one character being different from '(HL|...|NB)'. So it makes no sense to search for 'zero'. It's the same condition at end of lines where we've got time data.

                      Since there's nothing to store, the alternation could be defined as non-capturing with '?:'. So you may want to replace the RegEx in the above mentioned command line with this better version.

                      > Once again many thanks are due.

                      It's been a pleasure! It keeps me in practice. I also like the precise requirements you are posting, and the good feedback you give including a full view of what comes out in the end.

                      Regards,
                      Flo
                    • Adrian Worsfold
                      Hello Flo (and others) I made a feature of these requirements on my blog too, and has concerned the last four entries, at http://pluralistspeaks.blogspot.com
                      Message 10 of 10 , May 26 4:23 PM
                        Hello Flo (and others)


                        I made a feature of these requirements on my blog too, and has concerned the last four entries, at

                        http://pluralistspeaks.blogspot.com

                        because that then links through to my Facebook pages and the people who, sometimes, also use CDs for music in services. I try to do a 'best practice' offering in collecting, editing and storing hymns and acquiring and using incidental music.

                        From this I have also made a list maker clip for my own CDs to produce a similar looking list, but different titling and file saving.

                        I do put my clipbooks out for others to use, and who knows who looks and gets the drift. They are on my website and the link page to them is now at https://dl.dropboxusercontent.com/u/28120070/pluralist/learning/ictlinks.html for that part that was neglected a little until recently.




                        Adrian Worsfold

                        http://www.pluralist.co.uk
                        http://pluralistspeaks.blogspot.com
                        pluralist@...
                        27-05-2013
                        ----- Received the following content -----
                        From: flo.gehrke
                        Receiver: ntb-clips
                        Time: 2013-05-26, 19:40:54
                        Subject: [Clip] Re: Twos and Threes


                        [Non-text portions of this message have been removed]
                      Your message has been successfully submitted and would be delivered to recipients shortly.