@drghty
By the way, you wrote “remove the last 5 lines from a text file”, but your example indicates removal of the last 5 characters from each line, so I assume the latter was correct.
@Mark-Olson
Ah, yes — my bad, and thanks much for the correction.
For @drghty , just to make sure you understand why Mark’s correction is potentially important, depending on the total content of your text file, my FIND pattern .{5}$ would also match up to five consecutive newline sequences, if your file has multiple consecutive newlines, if it does not include (?-s), or you don’t have . matches newline disabled.