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

Re: [Clip] find and replace clip

Expand Messages
  • Hugo
    ... Ctrl+D opens up a dialog box: Find/Replace in Files. If you select Replace in Files you just type in the searchterm (RegExp is supported) and the
    Message 1 of 42 , Oct 26, 2001
      ::Andrew::

      Ctrl+D opens up a dialog box: Find/Replace in Files. If you select
      Replace in Files you just type in the searchterm (RegExp is
      supported) and the replaceterm, the filemask etc. TIP: You can use a
      space in your Findstring to find all files that match the directory
      mask. Note that Replacement is possible without opening the files...

      F1 pops up contextual help in NoteTab, so if you're in the dialog
      box, hit F1: (excerpt follows)...

      "When you enable the Confirm option, matching files are displayed in
      a list box. You can then select which files you want to open in
      NoteTab when you are doing a find operation. If you are doing a
      replace operation, you can select which files should be processed;
      you can also open the selected files in NoteTab if you prefer. If the
      replace operation encounters binary files, it will display them in
      the list box even if you haven't set the confirm option."


      Hope this helps,

      Hugo
    • Hugo
      ... I still advise you to explore the script-piece I sent you earlier, it does exactly what you need without regexp. Place it in the loop-part and perform the
      Message 42 of 42 , Oct 26, 2001
        ::ANDREW::


        I still advise you to explore the script-piece I sent you earlier, it
        does exactly what you need without regexp. Place it in the loop-part
        and perform the replace action with the array as you already were
        examining.

        "Open FILE | Do this and do that | SAVE -> Go to the next file"


        You have to be careful with regular expressions, it is hard to test a
        pattern...

        1.
        If your {Hyperlink} part of your document looks like the example you
        gave, you could try building a specific expression such as:

        \{HYPERLINK\s*\n\n.*}

        This will match all occurences of text-fragments that
        contain "{HYPERLINK", "a space", "two linebreaks", "any character(s)"
        untill the last occurence of "}" at the last scanned line.

        If there are other patterns to match you could try using Alternation
        ("this|that" - see HELP)...

        You could use this regexp in CTRL+D, but keep in mind this may fail
        if the expression is eating too much resources. (You found that out
        already).


        2.
        Alternatively you could try to widen the scope of your search a
        little. If you know for sure that there will be always the same texts
        in front and after the piece of text that you are looking for, you
        could try adding these parts to your regExp. If you do that, you
        limit the scope of the search (am I still making sense?).

        In your case you could use

        {_blank">}\{HYPERLINK\a*\quot;\}

        The part _blank will be replaced by just using \1 in your replace-
        pattern. Normally \2-\9 should work as well for everything between
        {}, but maybe the escaped {} screw things up here. So if you need to
        add something to your findterm afterward, you cannot surround it in
        {} here. Example: just type http: after the expression in both the
        find-field and the replace-field.

        3.
        Alternatively, I just thought of that now, you could get rid of all
        of your empty lines before you do the actual replacement. And maybe a
        simple construct would do fine then... You have to study your
        material first before you can get the rewards... There are dozens of
        ways to do what you want, try to be creative...


        Bye,

        Hugo
      Your message has been successfully submitted and would be delivered to recipients shortly.