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

21795Re: [Clip] Selective Editing

Expand Messages
  • flo.gehrke
    May 20, 2011
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "Dave" <dmc43959@...> wrote:...

      @ Dave

      > would this clip work in notetab std ,the last thing it does is
      > replaces days should the numbers in front change ?

      Sorry, Dave. I haven't got NT Std (but NT Pro 6.2 only) and can't figure out what the problem is with the Std version. I hope someone else could explain this...

      @ diodeom

      > Maybe instead of numbering all lines -- unless that's useful
      > for something else -- if just the beginnings of copied lines
      > were flagged in the original doc with some unique marker

      Thanks, diodeom! According with your proposal the clip could look something like...

      ^!SetWizardWidth 55
      ^!Goto ^?{Choose action:==Edit|Restore}

      :Edit
      ^!Set %Search%=^?{Enter search criteria:}
      ^!Replace "^(?=.*^%Search%)" >> "@@@" WARS
      ^!Set %Lines%=^$GetDocListAll("^@@@\K.*^%Search%.*$";$0\r\n)$
      ^!Toolbar New Document
      ^%Lines%
      ^!Goto End

      :Restore
      ^!SetListDelimiter ^%NL%
      ^!SetArray %Re%=^$GetText$
      ^!Close Discard
      ^!Jump Doc_Start
      ^!Set %Nr%=1

      :Loop
      ^!Find "^@@@.+$" RS
      ^!InsertText ^%Re^%Nr%%
      ^!Inc %Nr%
      ^!If ^%Nr% > ^%Re0% End
      ^!Goto Loop

      The concept with line numbers might have two advantages:

      1. You could easily identify the original lines by their number when toggling between the output lines and the source document.

      2. Without numbers the sequence of replacements would get into disorder in case the user removes a complete line (or paragraph) from the output. With numbers the clip will correctly identify the lines to be replaced in any case.

      Anyway, let's leave it to the user which version to choose. It's been just a basic idea for a kind of "Selective Editing"...

      Regards,
      Flo
    • Show all 5 messages in this topic