Finding strings and placing into new file

Finding strings and placing into new file

2
NewbieNewbie
2

    Jul 29, 2004#1

    I tried searching for a string that I defined in "Find in files". I was able to find it (having multiple occurances) and I would like to send the results to a new file. However, when I turn on "Results to edit window" (so I can save the results) it sends the full path of the file to the edit window as well as the search string data. The bottom line is I only the actual data defined by my search in my new file, not other misc information.

    Help. I am new to this.

    Thanks
    Steve

    :?:

    206
    MasterMaster
    206

      Jul 29, 2004#2

      Hi, and welcome.

      This macro looks okay on my system. Just run it after you have the search results displayed. If you don't like the results, say something and we'll get it right.

      Make sure you check the "Continue if a Find With Replace Not Found" box when you create the macro.




      InsertMode
      ColumnModeOff
      HexOff
      UnixReOn
      Top
      Find RegExp "^[A-Z][:].+[:] "
      Replace All ""
      Top
      Find RegExp "^Find.+\p"
      Replace All ""
      Top
      Find RegExp "^Found.+\p"
      Replace All ""
      Top
      Find RegExp "^Search.+\p"
      Replace All ""
      Top
      Find RegExp "^----.+\p"
      Replace All ""

      2
      NewbieNewbie
      2

        Jul 29, 2004#3

        I get an error message when I try to close and update the macro. "Incorrect macro command in macroline". I did see in your response the line: Find RegExp "^[A-Z][:].+[:] " has a space between the last [:] and the end quote. So, I did try changing it to Find RegExp "^[A-Z][:].+[:]" instead. This had no effect. I am on version 10.20b if that makes any difference.

        Thanks

        Steve

        206
        MasterMaster
        206

          Jul 29, 2004#4

          You've run into the "extra blank line at the end of the macro" error. :D