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

Re: Selective Editing

Expand Messages
  • 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
    Message 1 of 5 , May 19, 2011
    • 0 Attachment
      Flo wrote:
      >
      > Occasionally, I want to do a kind of 'Selective Editing'. That is, not to edit a whole document but selected lines only.
      > (...)
      > Pease porridge hot,
      > Pease porridge cold,
      > Pease porridge in the pot,
      > Nine days old.
      > (...)
      > ^!Keyboard CTRL+A ALT+M L N #1# ENTER
      > ^!Replace "^\x20+" >> "0" AWRS
      >

      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, the final loop (which pastes edited lines) could rely just on the top-to-bottom sequence of rapid finds (e.g. "^\*.+") precisely matching the order of array elements (lines) to be inserted.

      I actually like the idea of "perpetual stew" (e.g. bigos); I just somehow cannot manage to make it bad enough -- and enough of it -- to last to its target maturity. :)
    • flo.gehrke
      ... @ Dave ... 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
      Message 2 of 5 , 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
      Your message has been successfully submitted and would be delivered to recipients shortly.