How to batch remove all lines after the nth line?
-
I have a bunch of text files each having a different number of lines. I want to keep only the first 100 lines in each file. How can I do that?
Thanks in advance,
Mel -
Find:
\A(?-s)(?:^.*\R){100}\K(?s).*
Replace: nothing
Search mode: Regular expressionSuggest backing up all of your data before trying this.
-
Works like a charm! Thank you very much @Alan-Kilborn🙏🏽
-
Learn more to be able to apply such techniques on your own in the future; start HERE.