Community
    • Login

    How to macro task " find in files"

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 737 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Tam LET
      Tam LE
      last edited by

      Hi All,

      I have a list of 100 different text lines like this, separated by LF.

      I recorded the macro function this way:

      copy the first text value, find in files, paste the copied text value, locate the files contain the text, save the file to specific folder, go back to the first line and delete, move the second value to the first line, stop record.

      When I run the record, It keeps getting the copied value of the first text line I copied when recording the macro. How do I make it record correctly ? Thanks a bunch

      CA465359216
      CS465362803
      CA465364349
      CS465364835

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Tam LE
        last edited by

        @Tam-LE ,

        Macro recording for searches records the text of the search – it doesn’t notice that you pasted the text into the search field. Sorry. I don’t think a macro is powerful enough for what you want.

        There are scripting plugins, which bring the full power of your favorite scripting/programming language (Python, Lua, JS,…). If you have a preference, I’d suggest installing that plugin and writing a script in that language that runs the appropriate Notepad++ commands. If you don’t know any of those languages, and if someone has enough details from you and enough time and interest, they might be willing to write a quick script for the PythonScript plugin (the most commonly-used scripting plugin in this forum) – but you will have to be more specific as to what you mean by each of your steps, because there’s lots of ambiguity. (For example, you said, “first text value” – but is that a character, a word, a line, a paragraph, a … Each of your brief phrases is way too short for anyone else to be able to help you translate that into code.) Actually, if you have saved your macro, then exit Notepad++, then open %AppData%\Notepad++\shortcuts.xml, and go to your saved macro, and copy all that XML and paste it in here, then select the text in your post and click the forum’s </> button to wrap it so it shows up in a plain text / code box – with the contents of your existing macro, we can get rid of all ambiguity about what you are selecting and copying, and I think there are a some of the regulars here with the skill to both read that macro and to translate those same ideas into PythonScript.

        1 Reply Last reply Reply Quote 4
        • PeterJonesP PeterJones referenced this topic on
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors