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

Re: [Clip] 3-Column Table

Expand Messages
  • Alec Burgess
    Not a solution (and not tested) but a suggestion for investigation ... My assumption is that somehow your find clause is matching something different (and
    Message 1 of 39 , Mar 11, 2011
      Not a solution (and not tested) but a suggestion for investigation ...
      My assumption is that somehow your find clause is matching something
      different (and probably smaller) than you intend.

      Try setting up the Replace box with
      Find=(?s)(\<td.+?\</td>\s*+){3}
      Replace=\<tr valign="middle">$0\</tr>

      First try "count" option to see how many matches it indicates ... that
      might give you a clue.
      Then try single-stepping through your target data (first with
      FindNext-No replace, then with Find followed by Replace, Replace , .... etc.

      Hopefully that will show what is the regexp is actually matching as
      opposed to what you think it ought to match.

      Failing that, I'm sure someone who gets to this after I've gone
      beddy-bye will have a better answer :-)

      --
      Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)



      On 2011-03-11 04:22, Ray Shapp wrote:
      >
      > Hi diodeom,
      >
      > I tried the following clip
      >
      > Three Cells Per Row
      > :Loop
      > ^!Replace "(?s)(\<td.+?\</td>\s*+){3}" >> "\<tr valign="middle">$0\</tr>"
      > ARSW
      > ^!IfError End
      > ^!Goto Loop
      >
      > It works great for finding three consecutive <td>...</td> cells, but I
      > have
      > (at least) two problems:
      >
      > 1. The clip inserts well over 100 consecutive strings consisting of
      > "</tr>" followed by 100s of "<tr valign="middle">" after each set of three
      > cells. Are the quotation marks around the word "middle" causing the
      > trouble?
      > 2. After it processes the final set of cells, the clip goes into an
      > endless loop inserting a stream of "</tr>" and "<tr valign="middle">"
      > strings until I manually abort the clip.
      >
      > The second problem can be ignored because I'll gladly abort the clip and
      > delete the extra insertions. Please tell me how to insert just one "</tr>"
      > and "<tr valign="middle">" after each three cells are found. The desired
      > result is:
      >
      > <tr valign="middle">
      > <td>...</td>
      > <td>...</td>
      > <td>...</td>
      > </tr>
      > <tr valign="middle">
      > <td>...</td>
      > <td>...</td>
      > <td>...</td>
      > </tr>
      > .
      > .
      > .
      > etc.
      >
      > The cells I need to arrange 3 per row can be seen at the following address
      > where all 39 current cells are shown on one very wide row in a table:
      >
      > http://www.classiccars.ws/projects/Sort%20Projects.htm
      >
      > Thank you.
      >
      > Ray Shapp
      >
      > On Thu, Mar 10, 2011 at 3:00 PM, diodeom <diomir@...
      > <mailto:diomir%40gmail.com>> wrote:
      >
      > >
      > >
      > > --- In ntb-clips@yahoogroups.com
      > <mailto:ntb-clips%40yahoogroups.com>, Art Kocsis <artkns@...> wrote:
      > > >
      > > > ^!Replace "(?s)(\<td.+?\</td>\R?){3}" >> "\<tr>$0\</tr>" ARSW
      > >
      > > > To Diodeom, Why is the \R required?
      > > > Without it the command works fine except when a line ends with a
      > "</td>
      > > >
      > >
      > > This pattern demands three *consecutive* cells with just a single
      > optional
      > > CRFL in between, but there could be all sorts of whitespace, both
      > vertical
      > > and horizontal, between ending and starting cell tags. If there are
      > any more
      > > line breaks or spaces/tabs before hitting the next opening <td>,
      > your \R?
      > > won't account for it/them. I'd suggest \s*+ in its place.
      >



      [Non-text portions of this message have been removed]
    • Eb
      Let me add to this, that NoteTab s clips started out as blocks of text, assigned to a keyword (the clip name). Even though clips can do much more than those
      Message 39 of 39 , Apr 5, 2011
        Let me add to this, that NoteTab's clips started out as blocks of text, assigned to a keyword (the clip name). Even though clips can do much more than those original ones, that early feature is still available, and a mix of text and clip code as well.

        In other words, this is not a designe error, but an evolution, where powerful features ware added, along with backward compatibility.

        The need to watch for blank lines in your code is at worst a trade-off for more features.

        By the way, Ray figured out one of the workarounds - jumping to a label, rather than SKIPping. Another workaround is to place semicolons at the start of every blank line, if its only purpose is to make the code more readable.


        Cheers,


        Eb

        --- In ntb-clips@yahoogroups.com, hsavage <hsavage@...> wrote:
        >
        > Axel Berger wrote:
        > > Ray Shapp wrote:
        > >> That looks dangerous because a person might add a few blank
        > >> lines to a clip to make it more legible,
        > >
        > > Begob, you're right! I was convinced that NoteTab would do the right
        > > thing and ignore emty lines, but it doesn't:
        > >
        > > ^!IfSame 1 1 Skip
        > >
        > > ^!Continue Not skipped
        > > ^!Continue skipped
        > >
        > > To me this is a design error and an important point to keep in mind.
        > >
        > > Thanks
        > > Axel
        >
        > Axel, Ray,
        >
        > It is stated in NoteTab help that only 'commented lines, those
        > beginning with semi-colon are not counted during clip execution.
        >
        > SKIP
        > will skip the next instruction (text and blank lines are counted, but
        > not commented lines).
        >
        >
        > ···············································
        > ¤• JD#...91 - ¤• SL...727 - 11.04.01~19.38.19
        >
        > • If you write "WASH ME" on my truck,
        > • I'll carve "RESUSCITATE ME" on your chest!!!
        >
        > € hrs € hsavage € pobox € com
        >
        > ^!Skip
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.