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

[Clip] Re: Twos and Threes

Expand Messages
  • 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 1 of 10 , May 26 5:21 AM
    • 0 Attachment
      --- 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 2 of 10 , May 26 9:34 AM
      • 0 Attachment
        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 3 of 10 , May 26 11:40 AM
        • 0 Attachment
          --- 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 4 of 10 , May 26 4:23 PM
          • 0 Attachment
            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.