How to macro task " find in files"
-
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 -
@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. -