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

Selective line merging

Expand Messages
  • Adrian Worsfold
    Hello This is probably very simple for some of you, but it isn t for me. A PDF copy produces a CD list like this (sample): 1 Temptations Papa was a Rollin
    Message 1 of 6 , May 22, 2013
    • 0 Attachment
      Hello

      This is probably very simple for some of you, but it isn't for me.

      A PDF copy produces a CD list like this (sample):

      1
      Temptations Papa was a Rollin Stone
      00:11:46
      2
      KamakawiwoOleIsrael Somewhere Over the Rainbow
      00:04:54.0
      3
      SheeranEd A Team
      00:04:21
      4
      PresleyElvis In The Ghetto
      00:02:47
      5
      Clannad I See Red
      00:04:24

      What clip can merge the three lines from each number so that they become

      1 Temptations Papa was a Rollin Stone 00:11:46
      2 KamakawiwoOleIsrael Somewhere Over the Rainbow 00:04:54.0
      3 SheeranEd A Team 00:04:21
      4 PresleyElvis In The Ghetto 00:02:47
      5 Clannad I See Red 00:04:24

      ?

      Incidentally I can manage a clip to remove the leading space, two zeros and hyphen in all cases 00: and replace them with a space, but even with a delay of 010 after inserting the text it doesn't seem to work despite a WAS condition at the end.

      Adrian Worsfold

      http://www.pluralist.co.uk
      http://pluralistspeaks.blogspot.com
      pluralist@...
      23-05-2013
      ----- Received the following content -----
      From: flo.gehrke
      Receiver: ntb-clips
      Time: 2013-05-22, 22:24:21
      Subject: Re: [Clip] Sorting and aligning a list


      [Non-text portions of this message have been removed]
    • John Shotsky
      Email messes up any blank spaces as leading or trailing characters, but we can eliminate them at the end anyway. Your comment about hyphens doesn t make sense,
      Message 2 of 6 , May 22, 2013
      • 0 Attachment
        Email messes up any blank spaces as leading or trailing characters, but we can eliminate them at the end anyway. Your comment about
        hyphens doesn't make sense, since there are no hyphens in your example.
        To state the task:
        A line of nothing but numbers and spaces, followed by a line of characters and spaces, followed by a line of numbers which include
        at least one colon and spaces should become one line.
        ;Trim off trailing spaces
        ^!Replace "\x20+$" >> "" ARSW
        ;Merge sections
        ^!Replace "^(\d+)\R(.+)\R(\d.*:.*)$" >> "$1 $2 $3" ARSW
        This could be done with only one line, but I find it simpler to remove spaces explicitly, so I don't have to explicitly deal with
        them after a .+, which will always gobble them unless a + is used on the spaces.

        Result:
        1 Temptations Papa was a Rollin Stone 00:11:46
        2 KamakawiwoOleIsrael Somewhere Over the Rainbow 00:04:54.0
        3 SheeranEd A Team 00:04:21
        4 PresleyElvis In The Ghetto 00:02:47
        5 Clannad I See Red 00:04:24

        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: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Adrian Worsfold
        Sent: Wednesday, May 22, 2013 18:12
        To: ntb-clips
        Subject: [Clip] Selective line merging


        Hello

        This is probably very simple for some of you, but it isn't for me.

        A PDF copy produces a CD list like this (sample):

        ^!Replace "<<>>([\d\.]+)\K( .+[^\r\n,]),?( \([\d\.]+[ to-]+[\d\.]+\))" >> "$3$2" ARSW

        What clip can merge the three lines from each number so that they become

        1 Temptations Papa was a Rollin Stone 00:11:46
        2 KamakawiwoOleIsrael Somewhere Over the Rainbow 00:04:54.0
        3 SheeranEd A Team 00:04:21
        4 PresleyElvis In The Ghetto 00:02:47
        5 Clannad I See Red 00:04:24

        ?

        Incidentally I can manage a clip to remove the leading space, two zeros and hyphen in all cases 00: and replace them with a space,
        but even with a delay of 010 after inserting the text it doesn't seem to work despite a WAS condition at the end.

        Adrian Worsfold

        http://www.pluralist.co.uk
        http://pluralistspeaks.blogspot.com
        pluralist@... <mailto:pluralist%40pluralist.karoo.co.uk>
        23-05-2013
        ----- Received the following content -----
        From: flo.gehrke
        Receiver: ntb-clips
        Time: 2013-05-22, 22:24:21
        Subject: Re: [Clip] Sorting and aligning a list

        [Non-text portions of this message have been removed]



        [Non-text portions of this message have been removed]
      • Adrian Worsfold
        Thank you John Shotsky Interestingly, when the tracklist gets to 10 and over, only two lines are merged and the timing stays as a separate line. ^!Replace
        Message 3 of 6 , May 22, 2013
        • 0 Attachment
          Thank you John Shotsky


          Interestingly, when the tracklist gets to 10 and over, only two lines are merged and the timing stays as a separate line.

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

          1 Temptations Papa was a Rollin Stone 00:11:46
          2 KamakawiwoOleIsrael Somewhere Over the Rainbow 00:04:54.0
          3 SheeranEd A Team 00:04:21
          4 PresleyElvis In The Ghetto 00:02:47
          5 Clannad I See Red 00:04:24
          6 HL 018 Kremser choir 00:01:26
          7 HL 070 Hanover 00:02:50.0
          8 KingCarole Youve Got a Friend 00:05:09
          9 HL 051 Stuttgart 00:01:58.8
          10 Debussy Claire de Lune Suite extract
          00:01:08
          11 HL 210 Jerusalem choir
          00:02:46.3
          12 CollinsPhil Homeless
          00:04:14






          Adrian Worsfold

          http://www.pluralist.co.uk
          http://pluralistspeaks.blogspot.com
          pluralist@...
          23-05-2013
          ----- Received the following content -----
          From: John Shotsky
          Receiver: ntb-clips
          Time: 2013-05-23, 02:51:49
          Subject: RE: [Clip] Selective line merging


          [Non-text portions of this message have been removed]
        • Adrian Worsfold
          Hello John Shotsky Seems that the clip does work in that my original list was not original and wrong! Many thanks. Adrian Worsfold http://www.pluralist.co.uk
          Message 4 of 6 , May 22, 2013
          • 0 Attachment
            Hello John Shotsky


            Seems that the clip does work in that my original list was not original and wrong! Many thanks.





            Adrian Worsfold

            http://www.pluralist.co.uk
            http://pluralistspeaks.blogspot.com
            pluralist@...
            23-05-2013
            ----- Received the following content -----
            From: John Shotsky
            Receiver: ntb-clips
            Time: 2013-05-23, 02:51:49
            Subject: RE: [Clip] Selective line merging


            [Non-text portions of this message have been removed]
          • John Shotsky
            It might stop if there were extra blank lines in the source. In that case, just add a + after each R to eliminate them. Regards, John RecipeTools Web
            Message 5 of 6 , May 22, 2013
            • 0 Attachment
              It might stop if there were extra blank lines in the source. In that case, just add a '+' after each '\R' to eliminate them.

              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: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Adrian Worsfold
              Sent: Wednesday, May 22, 2013 21:03
              To: ntb-clips
              Subject: Re: RE: [Clip] Selective line merging


              Hello John Shotsky


              Seems that the clip does work in that my original list was not original and wrong! Many thanks.





              Adrian Worsfold

              http://www.pluralist.co.uk
              http://pluralistspeaks.blogspot.com
              pluralist@... <mailto:pluralist%40pluralist.karoo.co.uk>
              23-05-2013
              ----- Received the following content -----
              From: John Shotsky
              Receiver: ntb-clips
              Time: 2013-05-23, 02:51:49
              Subject: RE: [Clip] Selective line merging

              [Non-text portions of this message have been removed]



              [Non-text portions of this message have been removed]
            • flo.gehrke
              ... Isn t it just a matter of replacing each CRNL with a space except before numbers from 1 through 9 ? So there would be nothing to store and repeat with back
              Message 6 of 6 , May 23, 2013
              • 0 Attachment
                --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
                >
                > To state the task:
                > A line of nothing but numbers and spaces, followed by a line of
                > characters and spaces, followed by a line of numbers which include
                > at least one colon and spaces should become one line.
                > ;Trim off trailing spaces
                > ^!Replace "\x20+$" >> "" ARSW
                > ;Merge sections
                > ^!Replace "^(\d+)\R(.+)\R(\d.*:.*)$" >> "$1 $2 $3" ARSW

                Isn't it just a matter of replacing each CRNL with a space except before numbers from 1 through 9 ? So there would be nothing to store and repeat with back reference.

                The only condition: No runtime >= 10 hours ;-)

                ^!Replace "\R(?![1-9])" >> "\x20" WARS
                ^!Menu Modify/Spaces/Single Space
                ^!Jump 1

                Regards,
                Flo
              Your message has been successfully submitted and would be delivered to recipients shortly.