thomasm76 wrote:How does you Makro know if the EOF is reached for exiting the loop (the Makro works without IfEof)?
The loop in the macro is executed until no line with the starting phrase is found anymore. See
IfFound
...
Else
ExitLoop
EndIf
Many of my macros do not run till EOF, because they searches from top down until the searched string is not found anymore. Within a macro execution the configuration option
Continue find at End of File is ignored. (Except if Perl engine is enabled where still user dialogs are displayed if a string is not found till EOF while executing a search in a macro loop. This is of course a bug of v12.00 till current version 12.10a.)
thomasm76 wrote:Is there a Makro which first selects all consecutive lines and copy them in one sweep to the clipboard (like I would do it manually, it's quicker than copying every single line)?
Such a block selecting code is used several times in the posted macros. For example you have found the starting phrase in a line and want to copy everything from start of this line till next blank line (without the blank line).
UnixReOff
Key HOME
IfColNumGt 1
Key HOME
EndIf
StartSelect
Find RegExp Select "^p[ ^t]++^p"
Key UP ARROW
Copy
EndSelect
If your DOS terminated file does not contain trailing spaces on blank lines (because you have used TrimTrailingSpaces at start of the macro), this can be done without regexp search:
Key HOME
IfColNumGt 1
Key HOME
EndIf
StartSelect
Find Select "^p^p"
Key UP ARROW
Copy
EndSelect
And if you have enabled the configuration setting
Home Key Always Goto Column 1 a single Key HOME is also enough:
Key HOME
StartSelect
Find RegExp Select "^p^p"
Key UP ARROW
Copy
EndSelect
You see, I have to think about many problems when writing macros for general purposes posted here because I don't know the content of the file and the UE settings of the user.
thomasm76 wrote:In general, is it possible to search for lines NOT containing a search-string?
(e.g: Find RegExp NOT(%Starting phrase*^p)
As already written several times - no! Maybe with the Perl engine. I don't know too much about Perl regex. See for example
How to delete lines which do not contain specific word.