With UE v12.00+ and the Perl regular expression engine and simple IDs you can run a single regular expression find with the 10 IDs in an OR expression like
(ID1|ID2|ID3|ID4|ID5|ID6|ID7|ID8|ID3|ID10).
Or you use the following macro which is designed to find all strings from file 2 which contains 1 search string per line and collects the lines found with those strings in the windows clipboard. The macro is similar to the macro posted at
equivalent to egrep ??(extract line from big files).
You should have only the 2 files opened and file 2 must have the focus when you start the macro.
Disadvantage of this macro in comparison with a single Perl regular expression search: the lines are sorted by the search strings and duplicate lines are possible. But that can be also an advantage.
The macro temporarily modifies file 1. So it's not possible to have file 1 open in read-only mode. Well, the macro could be rewritten to not modify file 1 and use window/document switches. But this would slow down macro execution a lot.
After executing the macro the windows clipboard contains the lines with any of the search string from the list in file 2. Duplicate lines are possible if a line contains more than 1 search string from the list in file 2.
The macro property
Continue if a Find with Replace not found must be checked for this macro.
InsertMode
ColumnModeOff
HexOff
Clipboard 9
Bottom
IfColNum 1
Else
"
"
EndIf
Top
Loop
Find "^p^p"
Replace All "^p"
IfNotFound
ExitLoop
EndIf
EndLoop
SelectAll
Copy
EndSelect
Top
NextDocument
Bottom
IfColNum 1
Else
"
"
EndIf
Top
Paste
"»
"
Clipboard 0
ClearClipboard
Top
Clipboard 9
StartSelect
Key END
Cut
EndSelect
Key DEL
Loop
Find "^c"
IfFound
SelectLine
Clipboard 0
CopyAppend
Clipboard 9
Else
Top
IfCharIs "»"
DeleteLine
ExitLoop
Else
StartSelect
Key END
Cut
EndSelect
Key DEL
EndIf
EndIf
EndLoop
ClearClipboard
Clipboard 0