I know how to use VI to find lines longer than a certain number of characters:
/\%>80v.\+
But how do I search for lines shorter than a certain number of characters?
I know how to use VI to find lines longer than a certain number of characters:
/\%>80v.\+
But how do I search for lines shorter than a certain number of characters?
Use
/^.\{,25}$/
to find lines shorter than 25 characters.
/^\{,25\}$/
. –
Chartres Tried this on a large file and had to kill -9 vim after it didn´t finish after a few minutes (!). I love vim but this disappointed me somewhat. I wonder if this is implemented as a trendy new python plug-in or something. To find short lines in a more time-effective way I find that it is better to use
awk '{ if(length<YOURLENGTH) { print $0 }}'
© 2022 - 2024 — McMap. All rights reserved.