How can I remove all but the first n characters of a every line in the file buffer?
What I tried
Mark region C-x r k #but this is cumbersome when the length of lines are very varied, and there are over 100 lines
You can do a
replace-regexp like this:
This will match lines with at least 15 characters, and replace with the 1st 15 (which are saved as a match group).
Did you mention that n=15?